Measure and tune Java memory use
8 steps · about 4 h 45 min · Intermediate
- Map the garbage collector's job (reference, Oracle Java documentation, 35 min)
Connect allocation, reachability, collection pauses and throughput before changing runtime options.
- Choose performance measures (reference, Oracle Java documentation, 35 min)
Define latency, throughput and footprint goals so tuning has an explicit target.
- Enable useful GC evidence (reference, Oracle Java documentation, 35 min)
Select diagnostic logging and heap settings deliberately rather than copying an option bundle.
- Inspect a running JVM (reference, Oracle Java documentation, 35 min)
Query heap, class and native-memory information through a supported diagnostic command.
- Record runtime behaviour (guide, Oracle Java documentation, 40 min)
Capture allocations, pauses and application events with low-overhead flight recordings.
- Observe memory programmatically (reference, Oracle Java API, 30 min)
Expose stable heap and non-heap measurements without scraping human-oriented tool output.
- Distinguish pressure from leaks (guide, Oracle troubleshooting guide, 40 min)
Use growth after full collection and retained references to test whether memory is genuinely leaking.
- Compare heap snapshots (reference, Oracle Java documentation, 35 min)
Capture histograms or dumps before and after a reproducible workload and verify the effect of one change.