[.net] Memory leak

Started by
2 comments, last by Kruz 16 years, 10 months ago
My app keeps building memory and I don't know why. Is there a way to check which objects are in the memory of .Net app? My app contains custom objects, threads, and database connections; as far as I can see I've removed references by setting the objects to null when they complete the job, but still after an hour the apps memory grows more than 100MB.
Advertisement
Make sure you call Dispose() on anything that you created that implements IDisposable, so that unmanaged resources can be freed.

You might also want to read this; it might help you get moving in the right direction.
Did you run the CLR profiler on it?
Clr Profiler for 1.1
Clr Profiler for 2.0

It sounds like you have some references somewhere you're forgetting to null, maybe a list of objects or event handlers or delegates. The profiler should tell you what types of objects are allocated and you may be able to guess which objects are not being collected.
Thanks kanato, I'll check out Clr profiler.

This topic is closed to new replies.

Advertisement