JVM memory and garbage collection on one page
Page 2 of the JVM internals cheat sheet maps the HotSpot JVM's memory areas to the command-line flags that size them, and shows how the main garbage collectors lay out the heap. Start with page 1 for class loading and the overall architecture.
What's on page 2
- Memory areas: eden, survivor spaces, young and tenured (old) generations, permanent generation (up to Java 7) and metaspace (Java 8+), code cache and thread stacks
- Sizing flags:
-Xms,-Xmx,-Xss,-XX:NewSize,-XX:MaxNewSize,-XX:NewRatio,-XX:SurvivorRatio,-XX:PermSize,-XX:MaxPermSize,-XX:MetaspaceSize,-XX:MaxMetaspaceSize,-XX:ReservedCodeCacheSize, with the default ratios - Memory layout of the Serial, Parallel and G1 collectors, including G1's humongous regions for large objects
- Collector types: serial, parallel, stop-the-world and concurrent collection explained
Use it when you read GC logs, size a container's heap, or move an application from PermGen-era settings to metaspace.
Want to go deeper? The JVM Internals & Performance Tuning course covers this hands-on.