Page 1 of 1

How to find memory leak after a particular time

Posted: Thu Sep 13, 2012 9:55 am
by RaviKamana
Hi,
We are developing a gaming application in which memory leak is happening after a certain period of time,the time cannot be judged. So, is possible to find the leak using the .net profiler. If not then tell me some profilers that are suitable to my situation. :?:
Thank you.

Re: How to find memory leak after a particular time

Posted: Thu Sep 13, 2012 8:49 pm
by Andreas Suurkuusk
Yes, you should be able to find the memory leak using .NET Memory Profiler.

If you can run the application under the profiler you can collect a snapshot after the memory leak has occurred. By investigating this snapshot you will hopefully be able to determine what causes the leak.

You can also try to use the peak snapshot collection feature. Using this feature, you can automatically collect a snapshot when a memory usage peak has been reached. For more information, see http://memprofiler.com/onlinedocs/peaksnapshots.htm.

If you cannot run the application under the profiler for any reason, or if the memory leak quickly causes an OutOfMemoryException, then you can try to create a memory dump file of the application and import it into the profiler. It is possible to configure the ADPlus tool included with "Debugging Tools for Windows" so that it automatically creates a memory dump file when an OutOfMemoryException occurs. If this is something you are interested in, please tell me and I will give you some more information.

Re: How to find memory leak after a particular time

Posted: Fri Sep 14, 2012 12:47 pm
by RaviKamana
Hi thanks for your reply.
Actually if i want to get the sequence of snap shots at regular intervals once the profiler is started, is that possible?

Another thing is i want know the function which is taking more time?

Regards,
RaviKamana

Re: How to find memory leak after a particular time

Posted: Mon Sep 17, 2012 2:46 pm
by Andreas Suurkuusk
You can use the auto-collect feature to collect snapshots at regular intervals. You can define the auto-collected snapshots using the Tools->Options command, and then selecting the "Snapshots" page (see screenshot).
autocollect.png
Auto-collect
.NET Memory Profiler does not include a performance profiler, so you cannot get information about function timing.