• 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?
0
jindalee
Asked:
jindalee
1 Solution
 
doraemon2555Commented:
Try Reading This:
http://www.experts-exchange.com/Programming/Languages/.NET/Q_20874778.html

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.
0
 
jindaleeAuthor Commented:
Thank you. Good article and very useful.
0
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