PDA

View Full Version : How to measure memory of Qt Application,



rajeshs
10th July 2007, 06:20
Hello Friends,

I am using Qt4.2 with mingw compiler in windows, I want to mesure memory of my application, Now i am getting memory from task manager ?

Is there any tools for measure memory of qt applications in windows ? Please help me!

Thanks,
Rajesh.S

gri
10th July 2007, 10:57
You can check the memory usage of a class by overriding the new operator of it. But that does not include sizes of pointer-members which get new'ed later. Also if the class is created on stack, new does not get called ...

pdolbey
10th July 2007, 17:03
To start, Task Manager can give you an indication of memory utilisation, both actual an virtual if you add the appropriate columns. Very usefully it can also show the number the GDI handles taken up by the application since these can also "leak" if not properly released.

But better is to try using "perfmon" to measure the process memory for your application. There are a lot memory counters available, but I tend to graph the "Private Bytes" counter on the process as this has always been a reasonably good indicator of heap growth. I have single stepped though applications while watching this counted.

Then there's process explorer, that used to be on www.sysinternals.com, but this has now been swallowed up Microsoft - the link should still get you there.

Pete