Results 1 to 15 of 15

Thread: Qt 4.1 Memory Leak

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Saint-Petersburg (Russia)
    Posts
    41
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 2 Times in 1 Post

    Default Re: Qt 4.1 Memory Leak

    Quote Originally Posted by Codepoet
    We need another tool here: Valgrind gives only total statistics not time samples and peak memory usage. Does anybody know of such a tool?
    You mean memory leak or speed ?
    Succes is 5% of talent and 95% of work!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Qt 4.1 Memory Leak

    Valgrind is slow, yes - but that is not the reason: Valgrind does not collect statistics about things like:
    • maximum amount of memory used
    • memory usage while the application runs
    • graph of used memory by elapsed time

    These 66MB are the total amount of memory the program allocated during the whole run. But we are interested in how much did it use at any given time. That is a big difference since memory is freed again, then allocated and so on. We have many short lived objects.

    At the moment I'm trying memprof but it crashes

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Qt 4.1 Memory Leak

    Limit resources which can be given to a single process to a known amount, and you'll get info if the limit was met. See manual for ulimit for details. Or try mpatrol. Or do your own statistics, for example by overriding new and delete and using LD_PRELOAD.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: Qt 4.1 Memory Leak

    When running plugandpaint under mpatrol it's horribly slow, even slower then valgrind. Somewhere in mpatrol seems to be a bug because I constantly get errors about memmove on freed memory
    Nevertheless I've got some numbers: around 3.5 MB peak memory usage of plugandpaint


    I'll probably write my own library because I need one for my own job in the long term.

Similar Threads

  1. Memory leak detection
    By Sid in forum Qt Programming
    Replies: 8
    Last Post: 4th May 2011, 23:38
  2. memory leak question
    By cool_qt in forum General Programming
    Replies: 3
    Last Post: 20th January 2009, 08:49
  3. Memory leak weirdness
    By Darhuuk in forum General Programming
    Replies: 10
    Last Post: 10th January 2008, 19:51
  4. QPixMap and Memory leak
    By Krish_ng in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 15:18
  5. Memory Leak in my Application :-(
    By Svaths in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2007, 20:42

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.