Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What are generations and how are they used by the garbage collector?

user-image
Question ajoutée par Utilisateur supprimé
Date de publication: 2013/06/12
Daanish Rumani
par Daanish Rumani , Product Manager , Publicis Sapient

The garbage collector (GC) organises object in the heap into three generations based on their shelf life.
Generation0 consists of objects with the least shelf life and Generation2 of objects that tend to have the most shelf life.
Initially every object is classified by the GC in Gen0.
If the object survives garbage collection when GC attempts to free memory it is promoted to Gen1.
An object may survive collection if it being used in the application.
Similarly an object in Gen1 that survives collection is promoted to Gen2.
Because running the GC is time intensive the GC runs only when it is in need of memory.
Further the GC collects Gen0 more often than Gen1 which it collects more often than Gen2.
Detailed information from Microsoft itself at http://msdn.microsoft.com/en-us/library/ee787088.aspx

More Questions Like This

Avez-vous besoin d'aide pour créer un CV ayant les mots-clés recherchés par les employeurs?