Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: [Memory managament] long liveliness of application

  1. #21
    Join Date
    Aug 2012
    Location
    Montreal
    Posts
    14
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [Memory managament] long liveliness of application

    1. The C++ stack is pre-allocated and its size never changes. Whatever you allocate on the stack you will never see in the task manager or in a memory profiler that hooks on memory allocation functions.
    2. Qt uses PIMPL a lot, so any QObject allocated on that stack will actually have most of its data allocated on the heap.
    3. Variations of memory of +/- 100K is not a memory leak. They are often symptoms of an undisclosed implementation detail or OS memory management.
    4. I wouldn't worry about memory fragmentation until your application gets to 2GB of memory usage.


    Since the OP never claimed leaks of more than 100K over the lifetime of the application, I really wouldn't a memory leak there a all. Unless you have clear evidence that over a period of time, memory usage by the application has increased by at the very minimum 10MB (100MB would make it better), then I would just attribute that +/- 100KB to the task manager being not precise.

  2. The following user says thank you to maximebd for this useful post:

    d_stranz (17th August 2012)

  3. #22
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,325
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: [Memory managament] long liveliness of application

    Thanks for the clarification about the stack. I had forgotten about the pre-allocation; I guess that's why you get stack overflow sometimes :-) Likewise with PIMPL; if a QDialog contains other QWidgets, all of those will certainly be heap-allocated even if the dialog object itself isn't.

    And on Windows on my box at least (with 2GB RAM total), I can't get much over 1 GB of heap allocation before I run out of memory for a single app.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  4. #23
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [Memory managament] long liveliness of application

    windows has single process memory limits as well
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. QSqlDatabase best practices with long-running application
    By redBeard in forum Qt Programming
    Replies: 6
    Last Post: 17th October 2011, 19:32
  2. Replies: 2
    Last Post: 7th September 2011, 13:12
  3. Problem: the Application Takes very long time to build
    By Ma7moud El-Naggar in forum Qt Programming
    Replies: 5
    Last Post: 20th November 2010, 06:26
  4. Replies: 2
    Last Post: 5th October 2010, 08:20
  5. Replies: 3
    Last Post: 6th January 2010, 16:55

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.