• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Disposing, dereferencing and releasing memory when a program closes

Hello Experts

I believe that when I dereference a component, using (say) "customer = Nothing", that this means I can no longer use the component. I also believe that at some time later Garbage Collection will release the memory but until that happens the memory is unavailable for use.

I think that Dispose releases it immediately.

My question is, what is the correct sequence of actions to release resources when an application terminates?
1 Solution
Try Reading This:

In VB.NET, setting to Nothing does not give special help in releasing the memory. Calling Dispose() will release all unmanaged resources (non-.NET resources).

Just make sure you Dispose everything that you can dispose and let .NET do the job.

Or you can force GC to mark the collection by reading the above solution.
jindaleeAuthor Commented:
Thank you. Good article and very useful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now