The Young Generation and Old Generation are two major areas of the Java Heap Memory used by the Garbage Collector (GC) to manage objects efficiently. Newly created objects are initially allocated in the Young Generation. Objects that remain alive after multiple garbage collection cycles are promoted to the Old Generation.
Why Is Heap Memory Divided?
Studies have shown that most objects created by applications are short-lived.
Instead of scanning the entire heap repeatedly, the JVM separates memory into generations for better performance.
Java Heap
|
|---- Young Generation
|
|---- Old Generation
This design improves garbage collection efficiency.
Young Generation
The Young Generation is the area where all newly created objects are allocated.
Young Generation
|
|---- Eden
|---- Survivor S0
|---- Survivor S1
1. Object created in Eden.
2. Minor GC occurs.
3. Surviving objects move to Survivor Space.
4. Objects surviving multiple GC cycles are promoted to Old Generation.
String name = "Java";
Employee employee =
new Employee();These newly created objects are initially stored in Eden Space.
Old Generation
The Old Generation stores objects that have survived several Minor GC cycles.
A singleton configuration object that remains in memory throughout the application's lifetime is likely stored in the Old Generation.
How Objects Move Between Generations
Object created.
Eden Space
Minor GC runs.
Survivor Space
Object survives multiple Minor GCs.
Old Generation
Eden
|
Minor GC
|
Survivor Space
|
Multiple Survivals
|
Old Generation
Garbage Collection Types
1. Minor GC
Young Generation
2. Major GC / Full GC
Old Generation (and sometimes entire heap)
Comparison
Feature Young Generation Old Generation
Purpose New Objects Long-Lived Objects
GC Type Minor GC Major/Full GC
Frequency Frequent Less Frequent
Performance Cost Lower Higher
Object Lifetime Short Long
Memory Area Eden + Survivors Tenured Space
Consider an online shopping application.
Young Generation
Old Generation
Why Is This Important?
can help analyze memory behavior.
A concise interview answer is
The Young Generation stores newly created objects and is cleaned frequently using Minor GC. Objects that survive multiple garbage collection cycles are promoted to the Old Generation, which stores long-lived objects. Garbage collection in the Old Generation is less frequent but more expensive, making proper memory management important for application performance.
Last updated: 11 November 2026
Previous question: What are generics in Java?