Java memory & garbage collection
# The map of Java memory — where objects live, the lifecycle from allocation to reclamation, and how the memory-model and GC notes fit together.
❯ cat documents/
-
Java memory & garbage collection — the map
Concept
2026-08-09
The map of Java memory — where objects live, the lifecycle from allocation to reclamation, and how the memory-model and GC notes fit together.
-
JVM memory anatomy — heap, stacks & metaspace
Concept
2026-08-09
The JVM's runtime data areas — heap, stacks, metaspace, code cache — plus object layout, TLAB allocation, reference strength and the OutOfMemoryError flavours.
-
The Java Memory Model — happens-before & visibility
Concept
2026-08-09
The JMM contract — happens-before, volatile, final-field semantics and safe publication — that makes concurrent Java analyzable.
-
GC principles & algorithms
Concept
2026-08-09
Reachability, the generational hypothesis and safepoints, then the canonical algorithms — mark-sweep, mark-compact, copying, tri-color concurrent marking and the barriers that keep it honest.
-
Garbage collectors compared — G1, ZGC, Shenandoah & the rest
Concept
2026-08-09
HotSpot's collectors — Serial, Parallel, G1, ZGC, Shenandoah, Epsilon — compared on algorithm, pause profile and throughput, with guidance on choosing and first-step tuning.