Course contents

Module 06

JVM Internals & Memory

What happens inside the JVM: class loading, JIT, memory areas, garbage collectors and troubleshooting memory problems.

Premium3 free lessons5 topics26 lessons & question sets0 ready

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.

  1. How the JVM executes your codeLessonFreeSoon
  2. Class loading and classloadersLessonPremiumSoon
  3. Bytecode basicsLessonPremiumSoon
  4. The interpreter and JIT tiersLessonPremiumSoon
  5. JVM architecture: interview questions & scenariosInterview Q&APremiumSoon

Memory areas

Stack, heap, Metaspace and how objects are laid out.

  1. Stack vs heapLessonFreeSoon
  2. Metaspace: where classes liveLessonPremiumSoon
  3. Object layout and headersLessonPremiumSoon
  4. Escape analysisLessonPremiumSoon
  5. Memory areas: interview questions & scenariosInterview Q&APremiumSoon

References

Strong, soft, weak and phantom references.

  1. Strong, soft, weak and phantom referencesLessonPremiumSoon
  2. References: interview questions & scenariosInterview Q&APremiumSoon

Garbage collection

How GC works and how each collector differs.

  1. How garbage collection worksLessonFreeSoon
  2. Generational collectionLessonPremiumSoon
  3. Serial and Parallel collectorsLessonPremiumSoon
  4. The G1 collectorLessonPremiumSoon
  5. ZGC and ShenandoahLessonPremiumSoon
  6. Choosing a garbage collectorLessonPremiumSoon
  7. Garbage collection: interview questions & scenariosInterview Q&APremiumSoon

Troubleshooting

GC logs, leaks, OutOfMemoryError and dumps.

  1. Reading GC logsLessonPremiumSoon
  2. Memory leaks in JavaLessonPremiumSoon
  3. Types of OutOfMemoryErrorLessonPremiumSoon
  4. Heap dumps and analysisLessonPremiumSoon
  5. Thread dumps and analysisLessonPremiumSoon
  6. Troubleshooting: interview questions & scenariosInterview Q&APremiumSoon

Module interview question bank

Finish the module

Module interview question bank

Every interview question worth practising for JVM Internals & Memory, grouped by topic, with model answers, how to say them and what-if follow-ups.

Being written: it grows as the topics in this module are finished

PremiumSoon