Results 1 to 3 of 3

Thread: When does Qt release memory and resources?

  1. #1
    Join Date
    May 2008
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default When does Qt release memory and resources?

    Hi!

    I've been trying to monitor my application's memory usage and it appears that the memory is not immediately released by Qt when destroying/releasing objects such
    as list view items. I have a list view with hundreds of item widgets in it and I can see the memory increase as new items are created and added into the list. However, as I destroy the widget items, I can't see the memory footprint decrease. Does Qt release the resources at a later time? If so, is there documentation that states this kind of memory management?
    Thanks in advance for any help.

    regards,
    jim

  2. #2
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: When does Qt release memory and resources?

    Hi,

    Actually it should immediately release the sources. I mean it doesn't take that much time that causes you couldn't see it in your monitoring program.

    But I think you couldn't properly delete the items inside for some reason. Can you post a piece of code?

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

    Default Re: When does Qt release memory and resources?

    Quote Originally Posted by jimc1200 View Post
    I've been trying to monitor my application's memory usage and it appears that the memory is not immediately released by Qt
    Memory management is handled by the programming language you are using and its runtime environment. I might ask you how you see "the memory increase" but I'm expecting a reply such as "I can see that in the task manager" or "I can see that in top", so I'll tell you right away those are not a reliable way of measuring memory usage. If you want to know how memory allocation in your operating system works, consult its manual and other technical documents on it. Qt really has nothing to do with that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 2
    Last Post: 14th January 2012, 22:39
  2. Memory Release
    By mukunda in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2011, 18:27
  3. Resources do not show up in release mode ?!
    By ThomasBrown in forum Qt Programming
    Replies: 9
    Last Post: 14th April 2010, 16:15
  4. Do resources in QRC files consume memory?
    By TheNewGuy in forum Newbie
    Replies: 1
    Last Post: 7th December 2009, 08:07
  5. Dynamic memory release
    By linuxdev in forum Qt Programming
    Replies: 5
    Last Post: 11th December 2008, 06:22

Tags for this Thread

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.