Advanced
JVM Internals and Performance
Read the machine your code runs on.
Memory areas, garbage collectors and how to choose one, class loading, JIT behaviour, and profiling — so that "the service is slow" becomes a measurement and a fix rather than a guess.
6 lessons written2 modules~1h reading
After this course you can
- Explain the heap generations, what a GC pause is, and how G1 and ZGC differ
- Read a GC log and a heap dump and find a leak
- Profile a hot path with JFR or async-profiler and act on what it shows
- Tune the three JVM flags that matter and leave the rest alone
Curriculum
6 lessons · outlined lessons show their plan01
JVM memory areasSix areas and six OutOfMemoryErrors, each triggered; Native Memory Tracking explaining a 329 MB process with a 256 MB heap; and what objects cost, from a 16-byte Integer to compressed oops.13 minGarbage collectionReachability and cycles, most objects dying young in G1's own age log, humongous objects — and five collectors on one workload, where heap size mattered as much as the collector.16 minFinding memory leaksShallow against retained size, heap dumps and dominators, and JFR's old object sample tracing a ThreadLocal leak from a pool thread to the line that allocated it.13 minMemory
02
Class loading444 classes to print hello, parent delegation, "Cannot cast PriceRule to PriceRule", the NoClassDefFoundError that means a static initialiser failed, and the loader that fills Metaspace.12 minJIT and warm-upTiers in PrintCompilation, a first batch five times slower than steady state, escape analysis removing half the allocations, deoptimisation on a new type, and why one timing run lies.13 minProfiling and tuningReading a G1 log to its full GC, a JFR profile whose leaf view pointed away from the fix that gave 4.8× throughput, and what a 512 MB container really gives the JVM.15 min