01Chapter 1: Where the JVM keeps your dataYou should know basic Java syntax, classes, objects, and references. You should also know how to compile and run a Java program from the command line. This chapter uses Java 11 terminology and HotSpot behavior. Some implementation details can differ between JVMs.2 min read
02Chapter 2: Stack frames and the heapThis chapter assumes you know basic Java syntax, object-oriented programming, references, and how to run Java programs from the command line. It focuses on the working difference between a thread's stack frames and the shared heap.2 min read
04Chapter 4: How collectors reclaim memoryAssume you know basic Java syntax, objects, references, and how to run a Java program from the command line. This chapter focuses on the algorithms the JVM uses after it decides that heap memory should be reclaimed.3 min read
05Chapter 5: The generational heap: eden, survivor spaces, and old generationAssume you know basic Java syntax, object references, and how to run a Java program from the command line. This chapter focuses on how the heap is organized for generational garbage collection. It does not cover every collector implementation in detail.3 min read
06Chapter 6: Choosing a collector: Serial, Parallel, G1, and ZGCThis chapter assumes that you know basic Java syntax, objects, references, and how to run Java programs from the command line. A garbage collector is the JVM component that finds unreachable objects and reclaims their heap memory.3 min read
07Chapter 7: Soft, weak, and phantom referencesThis chapter assumes that you know Java objects are accessed through references and that the garbage collector (GC) reclaims objects that the running program can no longer reach. A reference object is a special object from java.lang.ref that gives the GC permission to treat its referent, the o3 min read
08Chapter 8: Metaspace and class metadataThis chapter assumes you know basic Java syntax, objects, references, and how to run Java programs from the command line. It focuses on Java 11 and later HotSpot JVMs.3 min read
09Chapter 9: Memory leaks in a garbage-collected languageThis chapter assumes that you know basic Java syntax, object references, collections, and how to run a Java program from the command line. It also assumes that the JVM uses garbage collection to reclaim objects that are no longer reachable.3 min read
10Chapter 10: Reading GC logsThis chapter assumes you understand the heap, young and old generations, and the basic differences between Java garbage collectors. You should also be able to run a Java program from a command line.2 min read
11Chapter 11: Heap sizing and basic tuningThis chapter assumes you can compile and run Java programs from the command line. You should also understand that variables hold references to objects, while the objects themselves usually live on the heap.2 min read
12Chapter 12: Understanding OutOfMemoryErrorThis chapter assumes basic Java syntax, object references, and running Java programs from the command line. It also assumes you understand that garbage collection removes objects that are no longer reachable.2 min read
13Chapter 13: Diagnosing with heap dumps, jcmd, and Java Flight RecorderAssume you can run Java programs from a command line and understand objects, references, and the JVM heap. This chapter shows how to investigate high memory use, frequent garbage collection, and OutOfMemoryError in Java 11.3 min read