Garbage Collection

 

+

Search Tips   |   Advanced Search


Both of the JVMs for WebSphere provide a clean-up process called "garbage collection" to ensure that, as the code objects in the heap cease to be used or referenced by an application, they can be cleared out of the heap automatically to free up space for more objects.

The garbage collection process is also known as "the garbage collector"; it works by searching the heap for unreferenced objects, collecting them, and clearing them. A typical garbage collection run executes what is known as a mark, sweep, and compact (MSC) operation. In the mark phase, the garbage collector traverses the heap, looking for objects that are still being referenced, and tags each of these objects for survival. In the sweep phase, the garbage collector deletes all the objects that were not tagged for survival, freeing up valuable space. Finally, in the compact phase, the garbage collector arranges the remaining objects in the heap in order to defragment the heap and expose larger segments of contiguous space.

By default, garbage collection is a stop-the-world (STW) operation. This means that while any part of the MSC process is going on, the JVM is working only on garbage collection and not on processing the application.

 

Related tasks

Tune Java virtual machines
Tuning the application serving environment

 

Related Reference


Java virtual machine settings