Results 1 to 3 of 3

Thread: heap memory size

  1. #1
    Join Date
    Jan 2011
    Location
    Pearl of the Orient Seas
    Posts
    40
    Thanks
    12
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default heap memory size

    is there a way to find out the heap memory size?

    I'm creating an application that dynamically creates objects, and i need to find out if the created objects are destroyed when a certain condition is met. And one way to find out if the objects are destroyed is by finding out the heap memory size, before the object is created and the size after it was destroyed.

    Is there any way to do this?

    Thank you very much.

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: heap memory size

    And one way to find out if the objects are destroyed is by finding out the heap memory size, before the object is created and the size after it was destroyed
    Thats unreliable method, you can have less memory available after releasing the objects, because some background app could use it.
    If those objects are QObject-based you can connect to "destroyed()" signal. If not, use some kind of reference-counting to track down the number of existing objects.

  3. The following user says thank you to stampede for this useful post:

    aya_lawliet (5th September 2011)

  4. #3
    Join Date
    Jan 2011
    Location
    Pearl of the Orient Seas
    Posts
    40
    Thanks
    12
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: heap memory size

    Thank you very much for your input. I will try that.

Similar Threads

  1. How to decrease the model size in memory?
    By mismael85 in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2011, 10:55
  2. how to fing the stack memory size ?
    By john_god in forum General Programming
    Replies: 2
    Last Post: 17th June 2009, 01:30
  3. heap corrupted
    By dognzhe in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2009, 02:54
  4. Qt Memory size problem ?
    By nrabara in forum Newbie
    Replies: 1
    Last Post: 29th September 2008, 15:27
  5. QThread and heap
    By paranoid_android in forum Qt Programming
    Replies: 2
    Last Post: 9th March 2006, 10:13

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.