Home > DeveloperSection > Interviews > How you can force the garbage collection?

Posted on    December-13-2010 12:00 AM

 Java Java 
 1 Answer(s)
  1063  View(s)
Rate this:

Mahesh Rawat
Mahesh Rawat

Total Post:138

Posted on    December-14-2010 1:00 AM

You can't force it but you call System.gc(), which is a "hint" to the runtime engine that now might be a good time to run the GC. But garbage collection using this method is not guaranteed to be done immediately.

Don't want to miss updates? Please click the below button!

Follow MindStick