Q

Garbage collection issues in .NET

Are there any known issues with garbage collection in .NET? I have a C# Web forms application that sometimes stops responding for no apparent reason, and I suspect garbage collection may play a role here. Thoughts?
No, to my knowledge there are no problems with the .NET garbage collector. However, that doesn't mean you are not experiencing problems with object disposal because of misuse. Having said that, the honest truth is you're much more likely to find the source of your problem in your own code. I would try to carefully pinpoint the methods/classes that are involved with your lockups, and then try to understand how they relate to each other when the objects are invalid (i.e., after they have been disposed). The chances are much higher that you simply have a logic bomb over the chances that the .NET garbage collector is simply "locking up." You need to carefully review the code in your Dispose methods if you have modified them, as well as any cleanup methods that you would call as you try and close things down, whether they be Form classes or other classes. Take your time, insert some breakpoints, and begin debugging your code with an open mind.
This was first published in February 2005

Dig deeper on Win Development Resources

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchCloudComputing

SearchSoftwareQuality

SearchSOA

TheServerSide

SearchCloudApplications

Close