Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Memory usage with QtQuick 2.0
Qt 6.11 is out! See what's new in the release blog

Memory usage with QtQuick 2.0

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qurx
    wrote on last edited by
    #1

    Hi folks,

    I'm writing a QtQuick 2.0 plugin which needs to allocate a "quite large" chunk of memory ( ~ 800Mo ). This allocation fails (bad_alloc, and it's not the ctors' which is throwing as I'm allocing an array of chars).

    A reduced example would be :

    @
    class Bar : QQuickItem
    {
    Q_OBJECT

    public:
    Bar::Bar()
    {

        char *foo = NULL;
    
        foo = (char*) malloc(800000000);
        if (foo)
        {
            *foo = 5;
            qDebug() <<  "Working";
        }
    }
    

    };
    @

    (Forget correctness, I just want it to be concise, and I use malloc just for the example, but it doesn't matter).

    This won't print "Working" as the alloc fails and malloc returns NULL.

    This is on Windows XP 32 bit.

    With a Qt Executable such an allocation works (as expected), so I'm wondering if there is something in the QtQuick machinery which tends to eat all the virtual address space.

    Any idea?

    Thanks!

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LouisselleB
      wrote on last edited by
      #2

      What are the things that you're going to do to at least help save money? College students need additional cash sometimes, and payday loans can help. While waiting on a paycheck from work, you may need to buy a brand new book last minute. Maybe you have to pay to print off a massive project. In any situation, you can get the help you need, so you can just stress about grades and not the money. Get more data at: "Payday Loan":https://personalmoneynetwork.com/payday-loans/

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OlivDev
        wrote on last edited by
        #3

        Hi Qurx,

        Don't you think that it could be a memory fragmentation issue ?

        I'll take a look to find a workaround but... you'll probably need to change your OS version.

        Bye

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved