Reputation: 23419
I have a simple C++ Service which reads text from a file and sends it over the Network. Over time the memory consumption of this service increases at customer site. No such behavior is observed in QA testing.
I would like to know if it is possible to extract all the String Objects that are in the memory at any given time.
Will it be possible to automate this process such that I take dumps from customer at different times and find out sizes or contents of the memory at each time and compare the results.
Upvotes: 1
Views: 1731
Reputation: 74692
http://msdn.microsoft.com/en-us/library/ff558947(v=vs.85).aspx is your best bet for what you want to do.
Upvotes: 1
Reputation: 896
For c++ the answer is no (In C# is a different story). In the c++ world, if you suspect you have a leak you would want to enable usermode stack tracing (+ust in gflags.exe) on the process before the "leak" occurs. The after the leak has occurred, get a dump of the process and examine it. To examine it (I have assumed you are using the native windows heap in this response), you will want to walk throught he heap structures to find out where the allocations are, then examine the stack backtrace for a sampling of the most common allocation size.
Example.
Upvotes: 3