Results 1 to 4 of 4

Thread: Memory Leak in Qt

  1. #1
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Memory Leak in Qt

    I hav developed an application for 32MB RAM.I need to know the places where memory leaks may occur.I hav a splitter with 5 listwidgets.I am taking data from file into QList and in turn putting into QListWidget.I hav taken 4 pages of items.I am also writing event filters for up and down keys.On a 32MB machine such a scroll takes a lot of time.Any idea were actually memory leaking occurs.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Memory Leak in Qt

    And why are you sure there are memory leaks?
    Could you post some code?

    That amount of memory is considered to be small for a long period of time ( years, even ), so there is no surprise the application is moving slow.

    Anyway, you need a profiler to do a memory analysis...
    See: http://trolltech.com/developer/knowl...25.9056652809/
    Purify can be downloaded as a trial version and Valgrind is free.

    Also, take a look at: http://trolltech.com/developer/knowledgebase/363/. Those tools not always give a correct report.

    Regards

  3. #3
    Join Date
    Jul 2007
    Posts
    57
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Memory Leak in Qt

    I hav update functions that update the 4 ListWidget.First page has 15 items and next scroll starts from 10 th element.I hav used scrollToItem to get the 10th element position.The scrolling of the items is taking more time on 32MB machine.Is there any alternative to improve performance.On the first display the 4 listwidgets are made visible.Next scroll is happening through the eventfilter.

    someSplitter->updateFirstView(0, end);
    There are 4 such methods for each listwidgets.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Memory Leak in Qt

    Considering you don't have a large number of items in the list widgets, I could say the delay is abnormal.

    But, I ask you again: can you post some code? Especially update*View() functions.

    I cannot tell you very much with the current information.
    You can try playing a little bit with QListWidget::setLayoutMode(QListWidget::Batched) and QListWidget::setBatchSize(5);

    Regards

Similar Threads

  1. Memory Leak in my Application :-(
    By Svaths in forum Qt Programming
    Replies: 4
    Last Post: 27th July 2007, 19:42
  2. Any reason for memory leak?
    By steg90 in forum Newbie
    Replies: 2
    Last Post: 10th May 2007, 15:00
  3. Memory leak
    By vvbkumar in forum General Programming
    Replies: 4
    Last Post: 2nd September 2006, 15:31
  4. Memory leak
    By zlatko in forum Qt Programming
    Replies: 8
    Last Post: 28th March 2006, 19:02
  5. Qt 4.1 Memory Leak
    By blackliteon in forum Qt Programming
    Replies: 14
    Last Post: 10th February 2006, 12:47

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.