Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Is it possible to force jvm for garbage collection? if yes then how?

user-image
Question added by himanshu mittal
Date Posted: 2013/06/26

no no u can never force the jvm for garbage collection.
System.gc() method only sends the request to jvm for the garbage collection.
its all depend on jvm wheather it has to run the garbage collector or not.

simply call the system garbage collector System.gc(), for more information see the gc() documentation....
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/System.html#gc()

System.gc() doesn't perform the proper GC tasks, it just makes the object a candidate for the GC.

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.