Tuesday, January 30, 2007

What do you know about the garbage collector?

Garbage collector is a runtime component of Java which sits on top of the heap: memory area from which Java objects are created and periodically scans it for objects which are eligible to be reclaimed when there are no references to these objects in the program. There is simply no way to force garbage collection, but you can suggest your intention of getting the object garbage collecetd to Java Virtual Machine by calling

code:
--------------------------------------------------------------------------------

System.gc().





SOURCE : www.referjava.com

No comments: