JVM Heap Memory: Layout, Garbage Collection, and Headers

Learn how JVM heap layouts differ by collector and JDK, where Metaspace fits, and how to measure object headers with JOL on your runtime.

published: reading time: 23 min read author: Geek Workbench
Quick Summary

Learn how JVM heap layouts differ by collector and JDK, where Metaspace fits, and how to measure object headers with JOL on your runtime.

JVM Heap Memory: Layout, Garbage Collection, and Headers

If you have ever stared at an OutOfMemoryError: Java heap space and wondered where to start, heap layout is one useful clue. The layout depends on the collector and JDK, though. This guide covers generational collectors, Metaspace, and a JOL measurement of object headers on one specific runtime.

Introduction

Some HotSpot collectors use young and old generations. Others use different region and collection models, and the exact layout changes between releases. Metaspace is separate from the Java heap and stores class metadata, so OutOfMemoryError: Metaspace points to a different memory area than OutOfMemoryError: Java heap space.

Object-header sizes are runtime-specific. Architecture, compressed object references, compressed class pointers, object alignment, and compact-header support all affect the result. The JOL example below records one OpenJDK 21 configuration; measure the JDK you are diagnosing instead of treating its byte counts as a rule for every JVM.

When to Use This Knowledge

Use when:

  • Diagnosing OutOfMemoryError: Heap Space errors
  • Tuning garbage collector settings for specific workloads
  • Analyzing memory dumps (heap dumps, hprof files)
  • Optimizing applications with large object graphs or high allocation rates
  • Choosing between different GC algorithms based on heap behavior

Do not use when:

  • Writing simple applications with predictable memory usage
  • Using managed languages/platforms that abstract away memory details
  • Debugging issues unrelated to memory (e.g., CPU bottlenecks)

When NOT to Use This Knowledge

If you are working on short-lived applications with predictable allocation patterns, the JVM defaults handle memory management fine. Tuning SurvivorRatio and tenuring thresholds for a batch job that runs once daily and exits is premature optimization that adds complexity without measurable benefit.

Most applications never need custom heap tuning. Modern GC collectors like G1 and ZGC self-tune effectively for most workloads. If you are not hitting memory errors in production, the default heap settings are probably fine.

In managed environments like Kubernetes, or when using a platform-as-a-service provider that abstracts memory configuration, deep heap knowledge has limited practical value. Focus on application-level concerns like algorithm efficiency and avoiding unnecessary allocations instead. For continued learning on JVM tuning, explore the Advanced Java & JVM Internals roadmap.

JVM Heap Memory Architecture

This diagram shows the classic generational layout used by collectors such as Serial GC and Parallel GC. It is a useful model for those collectors, not a physical map shared by every JVM. G1 is generational too, but manages the heap as regions. ZGC and Shenandoah have their own layouts and version-specific generational modes.

graph TB
    subgraph JVMHeap["JVM Heap Memory"]
        subgraph YoungGen["Young Generation (classic layout)"]
            subgraph Eden["Eden Space"]
                E["Objects allocated here"]
            end
            subgraph SurvivorS["Survivor Space S0"]
                S0["Survivors after minor GC"]
            end
            subgraph SurvivorS1["Survivor Space S1"]
                S1["Survivors after minor GC"]
            end
        end
        subgraph OldGen["Old Generation (classic layout)"]
            OG["Long-lived objects promoted from Young Gen"]
        end
    end
    subgraph NativeMemory["Native Memory"]
        MS["Metaspace - Class Metadata"]
        CCS["Compressed Class Space"]
        TH["Thread Stacks"]
        DM["Direct Memory Buffers"]
    end

    E -->|"Young collection"| S0
    E -->|"Young collection"| S1
    S0 -->|"survival and collector policy"| OG
    S1 -->|"survival and collector policy"| OG

    class E eden
    class S0,S1 survivor
    class OG old
    class MS,CCS,TH,DM native

How collector layouts differ

Collector Useful mental model Version notes
Serial and Parallel GC Eden, Survivor spaces, and an old generation The classic layout shown above; tuning options still depend on the JDK.
G1 A heap divided into regions that can serve young or old roles Do not picture Eden and old generation as fixed contiguous ranges.
ZGC A low-latency collector with its own heap management Generational ZGC arrived as an experimental option in JDK 21, became the default mode in JDK 23, and replaced the non-generational mode in JDK 24.
Shenandoah A concurrent collector with collector-specific heap management Upstream OpenJDK 25 added an experimental generational mode, selected with -XX:ShenandoahGCMode=generational. Check the JDK distribution’s documentation for availability.

See the JDK 25 collector guide, JEP 439, JEP 474, JEP 490, and JEP 521 for release-specific details.

Young Generation Details

In Serial and Parallel GC, new objects usually start in Eden. Live objects can move through Survivor spaces before promotion to the old generation. G1 also uses young and old regions, but it does not divide the heap into the fixed Eden/S0/S1 spaces shown in the classic diagram.

  • Eden Space: Where allocations start. Most objects die here before they ever get promoted anywhere.
  • Survivor Spaces (S0 and S1): Two regions that hold objects that survive a minor GC. Objects cycle between S0 and S1, getting older with each pass - this is called “aging.”

Object allocation flow in Serial and Parallel GC

  1. New object allocated in Eden space
  2. Minor GC runs - live objects are copied to S0 (or S1)
  3. Objects in S0 age and are copied to S1 during next minor GC
  4. This ping-pong process continues
  5. Objects are promoted according to collector policy, age, and available Survivor space. -XX:MaxTenuringThreshold is a limit, not a guarantee that every object survives exactly that many collections.

Tenuring options and their effect vary by collector and JDK. Check the flags and GC logs for the runtime in use before changing them.

Old Generation Details

For collectors with an old generation, objects may be promoted there after surviving young collections or when Survivor space is insufficient. The details depend on the collector.

Characteristics:

  • Holds objects the collector treats as old or long-lived
  • Collection frequency and pause behavior depend on the collector
  • It is not a separate generation in every collector mode

When objects get promoted:

  • They survive enough young collections under that collector’s policy
  • Survivor space is insufficient
  • A collector-specific policy may allocate a large object directly into an old area

Metaspace vs Heap

Metaspace is not on the heap at all. It lives in native memory, which trips up a lot of people who see OutOfMemoryError: Metaspace and assume they need to bump -Xmx.

graph LR
    subgraph NativeMemory["Native Memory"]
        MS["Metaspace"]
        CCS["Compressed Class Space"]
        TS["Thread Stacks"]
    end

    class MS,CCS,TS native

Metaspace

Metaspace holds:

  • Class metadata (class name, modifiers, field info, method signatures)
  • Constant pools
  • JIT compiled code
  • Internal JVM structures

Heap vs Metaspace at a glance:

Aspect Heap Metaspace
What lives here Object instances Class metadata
Where Java managed memory Native memory
GC Regular heap GC Own metadata GC
OOM type Heap Space Metaspace
Resize Via -Xmx Grows by default, capped by OS

Metaspace configuration:

  • -XX:MetaspaceSize - Initial size before first GC
  • -XX:MaxMetaspaceSize - Maximum (unlimited by default)
  • -XX:MinMetaspaceFreeRatio - Minimum free space after GC

Compressed Class Space

The Compressed Class Space exists because class metadata has different compression characteristics than object references. While regular Compressed OOPs work on object pointers (which point into the heap), class pointers must address Metaspace with a different addressing scheme. The JVM places class metadata that can be compressed into this dedicated region rather than mixing it with incompressible metadata in the main Metaspace.

Think of it as a specialized sub-region within Metaspace with its own size limit. The -XX:CompressedClassSpaceSize flag controls this region independently (default: 1GB). When this space fills up, you get OutOfMemoryError: Metaspace even if the rest of Metaspace has room. This surprises people using frameworks that generate many dynamic classes. The rest of Metaspace (for non-compressible metadata) grows beyond this limit by default, which is why a Metaspace OOM can occur with plenty of class space remaining.

# Check Compressed Class Space usage
jstat -gc <pid> | grep ccs

In practice, most applications never approach the 1GB default. Problems arise with OSGi containers, JSP engines, or any framework that creates dynamic class loaders with many generated classes. If you hit this limit, you either have a class loader leak (the usual culprit) or a legitimately large codebase requiring more class space.

Object Header Layout

HotSpot stores metadata with each object, but the header format depends on the JDK and VM options. JOL can inspect the layout used by a running VM.

Mark word

On a conventional 64-bit HotSpot layout, the mark word occupies 8 bytes. Its encoded contents can include identity-hash, locking, age, or collector state. The bit fields depend on the JDK and header mode; compact object headers change this layout.

Compact object headers were experimental in JDK 24 and became an opt-in product feature in JDK 25. Oracle’s JDK 27 release notes make them the default for HotSpot. See JDK 25 compact-header notes and JDK 27 changes.

Class pointer and object references

The class pointer identifies the object’s class metadata. Object references stored in fields are separate. On a 64-bit HotSpot VM, UseCompressedClassPointers can store the class pointer as a 32-bit offset; UseCompressedOops can store object references as 32-bit offsets. These options are related but independent, so “compressed OOPs” alone does not determine the whole header size.

Compressed pointers commonly use 4-byte offsets on 64-bit HotSpot, but the range is not a universal 32 GB cutoff. Heap size, object alignment, and JVM ergonomics affect whether compression is available. For exact flag behavior, see the JDK 25 VM options.

The class pointer identifies metadata for the object’s class, including array classes such as int[]. It does not describe the card table or remembered-set layout; those are separate collector structures.

Array length

In the HotSpot layout measured below, an array has a 4-byte length field after the mark word and class pointer. It stores the element count, not the total byte size. The JVM specification does not require this exact physical layout.

For example, new int[1000] has 1000 elements, regardless of whether the array occupies 4000 bytes of element data. In the measured configuration, the array header is 16 bytes.

For new int[100][20], Java creates an outer array of 100 references and 100 separate int[20] arrays. That is different from one int[2000] array, and each inner array has its own header.

The arraylength bytecode instruction returns an array’s length. Whether array iteration is faster than an ArrayList depends on the code and runtime; the presence of a length field alone does not establish a performance difference.

JOL measurement on OpenJDK 21

The following output was captured with JOL CLI 0.17 on OpenJDK 21.0.13, 64-bit Server VM (amd64, mixed mode). The run used -XX:+UseCompressedOops, -XX:+UseCompressedClassPointers, and -XX:ObjectAlignmentInBytes=8. The class below produced a 12-byte header and a 32-byte total instance size; the remaining bytes are fields and alignment padding.

public class LayoutExample {
    int id;
    Object reference;
    long timestamp;
}

Run JOL on Linux or macOS after placing jol-cli-0.17-full.jar beside the class file:

javac LayoutExample.java
java -XX:+UseCompressedOops \
     -XX:+UseCompressedClassPointers \
     -XX:ObjectAlignmentInBytes=8 \
     -javaagent:jol-cli-0.17-full.jar \
     -cp "jol-cli-0.17-full.jar:." \
     org.openjdk.jol.Main internals LayoutExample

JOL reported the following layout (address values omitted):

# VM mode: 64 bits
# Compressed references (oops): 3-bit shift
# Compressed class pointers: 3-bit shift
# Object alignment: 8 bytes

LayoutExample object internals:
OFF  SZ               TYPE DESCRIPTION
  0   8                    (object header: mark)
  8   4                    (object header: class)
 12   4                int LayoutExample.id
 16   8               long LayoutExample.timestamp
 24   4   java.lang.Object LayoutExample.reference
 28   4                    (object alignment gap)
Instance size: 32 bytes

On the same run, JOL reported a 16-byte int[] header: 8 bytes for the mark word, 4 for the class pointer, and 4 for the array length. JOL could not attach the Serviceability Agent in this environment, so it warned that compressed-reference addresses were estimates. Those addresses are omitted here; re-run JOL on the target VM before relying on its layout or sizes.

These numbers describe this OpenJDK 21 configuration only. A 32-bit VM, different compressed-pointer settings, another object-alignment value, or compact object headers can produce different sizes. JOL is a diagnostic tool, not a Java specification.

Production Failure Scenarios

These are the issues I see most often in production.

1. Premature Promotion (Promotion Failure)

Symptom: Frequent Full GC events even though Old Generation is not full.

Cause: In collectors with generations, high survival rates or limited Survivor space can increase promotion. Large-object allocation rules and flags such as -XX:PretenureSizeThreshold are collector-specific.

Solution:

# Increase Survivor spaces
-XX:SurvivorRatio=6
-XX:MaxTenuringThreshold=15

# Or increase total Young Generation
-Xmn512m  # Set Young Generation size

2. Metaspace Exhaustion

Symptom: OutOfMemoryError: Metaspace even though your heap has plenty of room.

Cause: Class loader leaks or frameworks that generate many classes at runtime (OSGi, JSP containers, dynamic proxies, CGLIB).

Solution:

# Set Metaspace limit
-XX:MaxMetaspaceSize=256m

# Monitor class loading
jstat -gc 12078 1000

3. Heap Fragmentation

Symptom: OutOfMemoryError: Heap Space but the heap dump shows plenty of free space scattered around.

Cause: Mark-Sweep leaves gaps. When a large object needs contiguous memory, it fails even though total free memory is sufficient.

Solution:

  • Use G1 or ZGC with better compaction
  • Increase -XX:MinHeapFreeRatio and -XX:MaxHeapFreeRatio

Trade-off Table

These are the knobs I reach for most often when tuning heap:

Configuration Default Benefit Cost
-Xms / -Xmx Ergonomic; JDK dependent Predictable memory footprint Wasted if overprovisioned
-Xmn (Young Gen Size) Collector/JDK dependent Control young collection frequency May starve old-generation space
-XX:SurvivorRatio Flag and collector dependent Tune Eden-to-Survivor sizing where supported Too high wastes space
-XX:MaxTenuringThreshold Flag and collector dependent Limit Survivor aging where supported Can increase promotion pressure
-XX:MetaspaceSize Platform dependent Delays first Metaspace GC Uses more native memory

Implementation Snippets

Checking Heap Usage

import java.lang.management.*;

public class HeapMemoryMonitor {
    public static void main(String[] args) {
        MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
        MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
        MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage();

        System.out.println("Heap Memory:");
        System.out.printf("  Used: %d MB%n", heapUsage.getUsed() / 1024 / 1024);
        System.out.printf("  Max: %d MB%n", heapUsage.getMax() / 1024 / 1024);
        System.out.printf("  Committed: %d MB%n", heapUsage.getCommitted() / 1024 / 1024);

        System.out.println("Non-Heap Memory (Metaspace):");
        System.out.printf("  Used: %d MB%n", nonHeapUsage.getUsed() / 1024 / 1024);
    }
}

Analyzing Object Header with JOL

import org.openjdk.jol.info.*;
import org.openjdk.jol.vm.*;

public class ObjectHeaderAnalysis {
    public static void main(String[] args) {
        Object obj = new Object();

        ClassLayout layout = ClassLayout.parseInstance(obj);
        System.out.println(layout.toPrintable());
    }
}

Maven dependency:

<dependency>
    <groupId>org.openjdk.jol</groupId>
    <artifactId>jol-core</artifactId>
    <version>0.17</version>
</dependency>

Observability Checklist

  • Monitor heap with jstat -gc <pid>
  • Enable GC logging: -Xlog:gc*
  • Track native memory: jcmd <pid> VM.native_memory summary
  • Use the target JDK’s documented diagnostic command when you need a heap dump; see heap dump analysis
  • Watch Metaspace in jstat -gc <pid> output (columns mc and ccs)
  • Set up Flight Recorder for allocation profiling
  • Look for frequent Full GC in your GC logs
  • Check compressed class pointer mode with -XX:+PrintCompressedOopsMode

Security Notes

  1. Heap Dumps can contain PII, passwords, tokens - treat them like sensitive data
  2. Native Memory Access (Unsafe) lets you read/write heap directly - lock down module access in production
  3. Memory Leaks can exhaust a containerized pod - set resource limits
  4. Class Structure in heap dumps can reveal implementation details to attackers

Common Pitfalls / Anti-Patterns

Pitfall What happens Fix
-Xmx set to container limit OOMKilled because OS, Metaspace, direct buffers need memory too Leave headroom
Ignoring Metaspace sizing Metaspace OOM in production Set -XX:MaxMetaspaceSize
Changing generation options without checking collector support May have no effect or make pauses worse Confirm the selected collector, then use GC logs to guide changes
Assuming free space rules out allocation failure Other memory limits or collector behavior may be involved Check the exact error and GC/native-memory data
Young gen too small Young collections may run more often Tune only if the selected collector exposes this control

Quick Recap Checklist

  • Generations are a collector model; Eden/Survivor/old is not every JVM’s physical layout
  • Metaspace lives in native memory, stores class metadata
  • Header sizes depend on JDK, architecture, pointer compression, and object alignment
  • Use JOL on the target runtime instead of assuming a fixed header size
  • Young-generation sizing controls vary by collector
  • Metaspace grows by default; set -XX:MaxMetaspaceSize if you need a cap
  • jstat, GC logs, and heap dumps are your main debugging tools
  • Tune heap flags only after checking the selected collector’s supported options

Interview Questions

1. Why is the JVM heap divided into Young and Old generations?

The generational hypothesis says that many objects become unreachable soon after allocation. Collectors that use generations can take advantage of this by collecting young objects separately. The exact layout and collection strategy vary: Serial and Parallel GC use Eden and Survivor spaces, while G1 uses regions. ZGC and Shenandoah have version-specific generational modes.

2. What is the difference between Mark-Sweep and Mark-Compact garbage collection?

Mark-Sweep marks reachable objects, then sweeps up the rest. The free memory ends up fragmented. Mark-Compact adds a compact phase that slides live objects together, eliminating the gaps. Compact is more expensive CPU-wise but prevents fragmentation issues that lead to allocation failures even when total free memory looks fine.

3. What causes premature promotion in the JVM?

In collectors with Survivor spaces, objects may be promoted when they survive enough young collections or when Survivor space is insufficient. Large-object allocation rules and tenuring behavior are collector- and JDK-specific; check the active collector's documentation and GC logs before changing flags.

4. What is Metaspace and how does it differ from the Java heap?

Metaspace lives in native memory, not on the heap. It stores class metadata - class definitions, method info, constant pools, JIT compiled code. The heap stores object instances. When Metaspace runs out, you get OutOfMemoryError: Metaspace, which you cannot fix by increasing -Xmx. Set -XX:MaxMetaspaceSize if you want an upper bound.

5. How does Compressed OOPs affect object header size?

UseCompressedOops controls object references in fields; UseCompressedClassPointers controls the class pointer. HotSpot often enables both on 64-bit VMs, but their availability depends on heap size, alignment, and JDK. In my OpenJDK 21.0.13 JOL run, both were enabled and a sample regular object had a 12-byte header. JDK 25's optional compact headers and JDK 27's default change that layout, so measure the target VM.

6. What is the purpose of Survivor spaces in the Young Generation?

Serial and Parallel GC use Survivor spaces to hold objects that survive a young collection. Their age and promotion depend on the collector's policy and available space. G1 also uses generations, but manages its heap as regions rather than fixed S0/S1 spaces. Other collector modes may not use this layout at all.

7. How does the generational hypothesis influence GC algorithm choices?

The generational hypothesis says many objects become unreachable soon after allocation. Generational collectors use that pattern to focus work on recently allocated objects. They do not all use the same algorithms: Serial and Parallel GC use a classic young/old layout, G1 manages regions, and newer ZGC and Shenandoah releases have their own generational modes.

8. What causes Metaspace to grow unbounded in production?

Class loader leaks are the usual culprit. Applications using OSGi, dynamic proxies, JSP containers, or frameworks that generate classes at runtime (CGLIB, bytecode generation) can accumulate class loaders that never become unreachable. Each class loader holds references to all classes it loaded. The fix is either to set -XX:MaxMetaspaceSize as a hard limit, or to find and fix the class loader leak. Use jstat -gc to monitor Metaspace growth and jmap -clstats to find class loader leaks.

9. What is the difference between -Xms and -Xmx?

-Xms sets the initial heap size at JVM start. -Xmx sets the maximum heap size the JVM can grow to. In production, setting them equal (-Xms=-Xmx) eliminates heap resizing overhead and prevents pause spikes from resize events. If they differ, the JVM will grow or shrink the heap dynamically, which triggers GC cycles and creates unpredictable pauses.

10. Why do 64-bit JVMs use Compressed OOPs?

On a 64-bit HotSpot VM, compressed object references often use 4-byte offsets instead of 8-byte pointers. They are commonly enabled by default, but the range depends on object alignment and VM ergonomics; 32 GB is not a universal cutoff. Check UseCompressedOops and ObjectAlignmentInBytes on the target VM.

11. What is object header fragmentation in the context of heap memory?

Object size includes header metadata, fields, and any padding needed for alignment. The total can change with pointer-compression settings, object alignment, and compact-header support. Use JOL on the same JDK and VM flags as the application; do not infer an exact size from field sizes alone.

12. How does -XX:PretenureSizeThreshold work?

Do not assume this flag applies to every collector. Allocation and promotion of large objects vary by collector and JDK. Check the selected collector's option documentation and measure the workload before tuning it.

13. What is the difference between Shallow Heap and Retained Heap in memory analysis?

Shallow heap is the size of the object itself (object header plus fields), not including anything it references. Retained heap is the total memory that would be freed if the object and all objects it references (directly or indirectly) were collected. Retained heap matters because a small object holding references to a large structure keeps that entire structure alive.

14. What is the relationship between heap size and GC pause times?

Heap size alone does not determine pause time. Live-set size, allocation rate, collector, and workload all matter. G1, ZGC, and Shenandoah perform much of their work concurrently, but still have stop-the-world phases. Compare GC logs and latency goals before changing heap size or collector.

15. Why might an OutOfMemoryError occur even when heap usage appears low?

The error may refer to a different memory area, such as Metaspace or native memory, so check the exact error and runtime metrics first. Fragmentation can matter for some allocation paths and collectors, but it is not the default explanation for low reported heap use. Use GC logs and a heap dump to narrow it down.

16. What is card marking and how does it optimize minor GC in generational collectors?

Some generational collectors use card tables or remembered sets to track references between heap areas. Their structure and granularity are collector-specific; do not assume every collector uses 512-byte cards or scans the same regions during a young collection.

17. What is TLAB (Thread Local Allocation Buffer) and how does it reduce allocation contention?

TLAB grants each thread a private allocation buffer in Eden space. Threads allocate from their TLAB using a bump-the-pointer technique that requires no synchronization for local allocations. Only when a TLAB is exhausted does the thread need to get a new TLAB from the global allocator, which requires a small atomic operation. This design eliminates contention on the global allocation path for the common case of thread-local allocation, significantly improving throughput under multi-threaded allocation.

18. How does object header layout differ between 32-bit and 64-bit JVMs with and without Compressed OOPs?

There is no single table that covers every JVM. In my OpenJDK 21.0.13 64-bit run with compressed class pointers, compressed object references, and 8-byte alignment, JOL reported a 12-byte regular-object header and a 16-byte int[] header. Compact headers and other pointer or alignment settings change those values. Run JOL against the exact JDK and flags you are investigating.

19. How does the promotion threshold (MaxTenuringThreshold) affect object promotion timing?

MaxTenuringThreshold limits how long an object can remain in Survivor space for collectors that use this option. The actual threshold can be lower and is affected by collector policy and available space. Check the selected JDK's flag documentation and GC logs instead of assuming every object survives exactly 15 collections.

20. What is the relationship between heap size, Survivor spaces, and promotion rate?

In collectors with Survivor spaces, small Survivor areas can increase promotion, but heap size alone does not determine the promotion rate. Allocation rate, object lifetimes, collector policy, and the sizes the JVM chooses all matter. Use GC logs to see whether promotion is a problem before changing Survivor sizing.

Further Reading

Conclusion

Some collectors use young and old generations; others organize and collect the heap differently. Metaspace is outside the Java heap. Object-header sizes depend on the VM, JDK, pointer-compression settings, alignment, and compact-header mode. Use JOL with the same runtime and flags as your application before drawing conclusions from byte counts.

Category

Tags

Related Posts

CMS and G1 Collectors: Low-Latency Garbage Collection

Understand G1 for current HotSpot deployments and CMS as a historical collector removed in JDK 14, with version-labeled examples and GC logging.

#jvm #garbage-collection #cms

GC Fundamentals: Mark-Compact, Copying, and Mark-Sweep

A JVM-focused guide to mark-sweep, mark-compact, and copying algorithms, their heap trade-offs, and how real collectors schedule GC work.

#jvm #garbage-collection #gc-algorithms

JVM GC Tuning: Heap Sizing and Threshold Optimization

Practical strategies for sizing JVM heap, tuning generation ratios, and optimizing GC thresholds to reduce pause times and improve throughput.

#jvm #garbage-collection #heap-tuning