Sign in to follow this  
Kruz

[.net] Memory leak

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this