Tuesday 15 June 2010

.net - Will my object always "be there"? -


If I have an object stored in memory, and I'm moving away from my application for an hour, then the object Will it still be there when I will be back?

In other words, will the NIT Garbage Collector remove its purpose because it has not been used for a while?

The garbage collector only collects items that are no longer referred to in your app. Garbage collector never will collect any object that is being used.

The "garbage collector" definition of "use" is based on the original basis. An object instance is the root if there are examples in the Other Object App Dynamic Context. Unless AppDomain hosts your application, it does not unload, any and all object examples that were in memory will remain in memory until they maintain roots in the application.


No comments:

Post a Comment