14, 13 chapters
memory and garbage collection
everything.gc
memory and garbage collection
allocation, reachability, and every collector from Serial to generational ZGC.
- 14.01the JVM's memory mapheap, stacks, metaspace, code cache. what lives where.
- 14.02allocation and TLABsnew is usually just a pointer bump. here's why it's so fast.
- 14.03reachabilityGC roots, and soft, weak and phantom references.
- 14.04how garbage collection worksmark, sweep, compact, copy. and tri-color marking.
- 14.05generational collectionmost objects die young. eden, survivors, and the old generation.
- 14.06serial and parallelthe stop-the-world collectors, and when they're still the right call.
- 14.07G1regions, remembered sets, mixed collections. the default collector.
- 14.08ZGCcolored pointers and load barriers. sub-millisecond pauses.
- 14.09Shenandoahconcurrent compaction with forwarding pointers.
- 14.10choosing a collectorthroughput, latency, footprint. pick two.
- 14.11reading GC logs-Xlog:gc and what all those numbers mean.
- 14.12memory leaksyes, java leaks. heap dumps, dominators, and the usual suspects.
- 14.13native memorythe memory the heap doesn't count. NMT and direct buffers.