Results 1 to 6 of 6

Thread: Dynamic memory release

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2008
    Posts
    31
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Dynamic memory release

    I have already done that (I have done a delete on the pointer in the Hash before removing the key), but my app shows a constant increase in the VIRTUAL MEMORY (using pmap), only while handling the data related to QHash<int, pointer>.

    I suspect only the pointer in QHash, pointing to QVector ....

    I am running 'top' command on the exe, at regular intervals and its showing a constant increase in Virtual Memory and resident memory. (Specifically in the anon Block, i think its Heap and related to Dynamic Memory i am using)

    Is there any way i can find out, why this is happening ? or which data in my app is taking memory and not releasing back to the Heap???....

    Is there any better way to detect Memory Leak in Qt.
    I have used Valgrind, but its at very low level...

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Dynamic memory release

    put qDebug in all dtors of your object and count number of messages after deleting or put breakpoints in all dtors and trace them or you can use 'valgrind' under Linux.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 0
    Last Post: 26th September 2008, 21:33
  2. Memory management
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:48
  3. Static vs. Dynamic Building for GPL Open Source Software Release
    By brent99 in forum Installation and Deployment
    Replies: 6
    Last Post: 11th March 2008, 20:46
  4. Memory leak weirdness
    By Darhuuk in forum General Programming
    Replies: 10
    Last Post: 10th January 2008, 18:51
  5. It seems that Qt does not release unused memory
    By iw2nhl in forum Qt Programming
    Replies: 31
    Last Post: 25th November 2007, 20:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.