Communiquez avec les autres et partagez vos connaissances professionnelles

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

Suivre

What are the levels of garbage collection in java?

user-image
Question ajoutée par chaitanya kumar
Date de publication: 2013/11/08
Ashok Yadav
par Ashok Yadav , trainee , S.O Infotech Pvt. Ltd.

 

Garbage Collection in Java is carried by a daemon thread called Garbage Collector. Before removing an object from memory Garbage collection thread invokes finalize () method of that object and gives an opportunity to perform any sort of cleanup required.  You as Java programmer can not force Garbage collection in Java; it will only trigger if JVM thinks it needs a garbage collection based on Java heap size.There are methods like System.gc () and Runtime.gc () which is used to send request of Garbage collection to JVM but it’s not guaranteed that garbage collection will happen.

if you like the answer then plz like it..... :)

More Questions Like This