What kind of garbage collection does the Java Virtual Machine use?
Ans : The Java Virtual Machine specification does not require any particular algorithm; the virtual machine implementation in the JDK 1.0.2 and 1.1 uses a partially conservative mark-and-sweep garbage collector, but other implementations may use other techniques. The Java Virtual Machine is required to provided automatic storage management for objects (class instances and arrays). In the JDK (1.0.2 and 1.1), for instance, storage space for all objects is allocated from a central Java heap, and a running Java program uses pointers into the heap area, called object references, to access its objects. When the program no longer holds a reference to an object, that object’s space on the heap can be reclaimed, or garbage collected. Automatic garbage collection means that the run-time system, not the programmer, is responsible for tracking memory use and deciding when to free memory that is no longer needed. This strongly boosts programmer productivity and code robustness. A Java Virtual Mach