Newly created object instances reside in the Java heap, which goes to different generations as shown below. Garbage collection is done by a daemon thread called ‘Garbage Collector’ which directs the objects through different spaces within the heap. Garbage Collection is done in 3 steps. 1. Ma...
As we shall see, there exists garbage collection algorithms that attempt to avoid the need to ever collect the entire heap in a stop-the-world pause. The reason this is an important property is that if at any point (even if infrequent), you stop the application for a complete collection ...