Understanding Java Garbage Collection

A Review of Garbage Collection Strategies and Methodologies

Virtually always, garbage collection in Java means figuring out how to delay compaction. This can be performed for some time on a younger generation of objects, because most of them have a short time span, but eventually old dead objects will require reclaiming.

Garbage collection can be delayed for a while longer by tracking the removal of old objects and using the freed memory. However, at some point this will also become fragmented and will need to be reclaimed. To conclude: garbage collection can be put on hold for some time, but not forever.

Most GC systems therefore stop application processing at some point to identify which objects are still being deployed. These can be collected, with the heap then being de-fragmented and compacted. The larger the heap, the longer the pause times, which lead to noticeable delays for users and poor application performance.

Garbage collection and the requirement for tuning can be entirely eliminated however - learn how by downloading this white paper.

© Azul Systems, Inc. 2017 All rights reserved.