Chapter 7: Garbage Collection & Serialization
Automatic memory management and object persistence form the foundation of JVM runtime stability. Understanding Generational GC mechanics, production GC collector algorithms (G1, ZGC), memory leak identification, and secure object serialization guarantees resilient backend services.
🧭 Subtopics & Curriculum
Click anywhere on a topic card below to open that subtopic note, or use the Obsidian button to open it directly in the Obsidian app:
7.1 Garbage Collection Fundamentals
- What is Garbage Collection?
- What exactly is "Garbage"?
- Why do we need Garbage Collection?
- Stack vs Heap
- How does Java know an object is unused?
- What are GC Roots?
- Does System.gc() perform Garbage Collection?
- Can we force Garbage Collection?
- How does Garbage Collection actually work?
- Generational Garbage Collection
- GC Phases (Steps of GC)
- Stop-The-World (STW)
7.3 Memory Leak
- What is memory Leak in Java?
- Common causes of Memory Leaks
- finalize() and Garbage Collection
- Can an object become eligible for GC without assigning null? ✅
- Can two objects reference each other and still be garbage? ✅
- What is OutOfMemoryError?
- Does OutOfMemoryError always mean a memory leak? ❌
- What is StackOverflowError?
- -Xms and -Xmx