Choosing a Garbage Collector
Freeing memory is overhead for every application, and you need a garbage collector that can do this in a way that aligns with your application’s performance goals.
The HotSpot Virtual Machine comes with a variety of high-performance garbage collectors to meet your performance needs. The JVM ergonomically selects a garbage collector, sizes it, and configures it for you, based on the system or container resources available for its use. While this works very well for most applications, some enterprise applications may need additional garbage collection tuning or may perform better with a different garbage collector in order to meet specific performance goals.
Choosing a garbage collector begins with defining your primary performance goals. Whether you need maximum application throughput, very low and predictable application pause times, a small memory footprint, or a collector that can scale to extremely large workloads with ease, the HotSpot VM has a garbage collector that can help you achieve those performance goals.
The HotSpot Virtual Machine Garbage Collection Tuning Guide contains all the information you need for choosing the best garbage collector for your needs. Use the links below to view the guide for your version of the JDK.
Last reviewed on Sat Feb 01 2025 00:00:00 GMT+0000 (Coordinated Universal Time)