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 ...
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 ...
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
Bookmarks