Garbage collection is a CLR feature which automatically manages memory. Programmers forget to release the objects while coding ..... laziness ( Remember in VB6 where one of the good practices is to set object to nothing).
CLR automatically releases objects when they are no longer referenced and in use.
CLR runs on non-deterministic to see the unused objects and cleans them.
One side effect of this non-deterministic feature is that we cannot assume an object is destroyed when it goes out of the scope of a function. Therefore, we should not put code into a class destructor to release resources.
so. The object which are not currently in use and their is no chances of it to be used in future, then GC can release its memory, but its not guaranteed that GC will relase the memory as soon as it is applicable to GC. but when the remain less in that situation it is guarantee that GC will release the memory.
we can run GC maiually:- System.GC.Collect() forces garbage collector to run.This is not recommended but can be used if
situations arises
5 comments:
Thanks for sharing this valuable article.
Angularjs Training in Chennai
Thanks for sharing this valuable article.
Angularjs Training in Chennai
Thanks for sharing with us.
Selenium Training in Chennai
I accept there are numerous more pleasurable open doors ahead for people that took a gander at your site.we are providing ReactJs training in Chennai.
For more details: ReactJs training in Velachery | ReactJs training in chennai
And indeed, Iam just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I have had.
Top Dotnet Training in Chennai
Top Matlab Training in Chennai
Top Embedded Training in Chennai
Top SAS Training in Chennai
Top Powerbi Training in Chennai
Top R Programming Training in Chennai
Top Javascript Training in Chennai
Top Oracle DBA Training in Chennai
Top RPA Training in Chennai
Top UIpath Training in Chennai
Top Big Data Hadoop Training in Chennai
Top Linux Training in Chennai
Top Cloud Computing Training in Chennai
Top Software Testing Training in Chennai
Top Blue Prism Training in Chennai
Post a Comment