Module 06
JVM Internals & Memory
What happens inside the JVM: class loading, JIT, memory areas, garbage collectors and troubleshooting memory problems.
By the end of this module you can
- Walk through class loading and JIT compilation
- Explain how each major garbage collector works
- Diagnose leaks and OutOfMemoryErrors from dumps and logs
JVM architecture
How the JVM loads, interprets and compiles your code.
- How the JVM executes your codeFreeSoon
- Class loading and classloadersPremiumSoon
- Bytecode basicsPremiumSoon
- The interpreter and JIT tiersPremiumSoon
- JVM architecture: interview questions & scenariosPremiumSoon
Memory areas
Stack, heap, Metaspace and how objects are laid out.
- Stack vs heapFreeSoon
- Metaspace: where classes livePremiumSoon
- Object layout and headersPremiumSoon
- Escape analysisPremiumSoon
- Memory areas: interview questions & scenariosPremiumSoon
References
Strong, soft, weak and phantom references.
- Strong, soft, weak and phantom referencesPremiumSoon
- References: interview questions & scenariosPremiumSoon
Garbage collection
How GC works and how each collector differs.
- How garbage collection worksFreeSoon
- Generational collectionPremiumSoon
- Serial and Parallel collectorsPremiumSoon
- The G1 collectorPremiumSoon
- ZGC and ShenandoahPremiumSoon
- Choosing a garbage collectorPremiumSoon
- Garbage collection: interview questions & scenariosPremiumSoon
Troubleshooting
GC logs, leaks, OutOfMemoryError and dumps.
- Reading GC logsPremiumSoon
- Memory leaks in JavaPremiumSoon
- Types of OutOfMemoryErrorPremiumSoon
- Heap dumps and analysisPremiumSoon
- Thread dumps and analysisPremiumSoon
- Troubleshooting: interview questions & scenariosPremiumSoon
Module interview question bank
Finish the module
Module interview question bankEvery interview question worth practising for JVM Internals & Memory, grouped by topic, with model answers, how to say them and what-if follow-ups.