What is the difference between Young Generation and Old Generation memory spaces?

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.

Diagram: Young and Old Generation in garbage collection
Young and Old Generation in garbage collection

Key Points

Why Is Heap Memory Divided?

Studies have shown that most objects created by applications are short-lived.

Examples

Instead of scanning the entire heap repeatedly, the JVM separates memory into generations for better performance.

Heap Structure

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.

It is further divided into

Structure

Young Generation

|

|---- Eden

|---- Survivor S0

|---- Survivor S1

Object Lifecycle

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.

Characteristics

Example

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.

Examples

Characteristics

Example

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

Step 1

Object created.

Location

Eden Space

Step 2

Minor GC runs.

Surviving object moves to

Survivor Space

Step 3

Object survives multiple Minor GCs.

Promoted to

Old Generation

Flow

Eden

|

Minor GC

|

Survivor Space

|

Multiple Survivals

|

Old Generation

Garbage Collection Types

1. Minor GC

Targets

Young Generation

Characteristics

2. Major GC / Full GC

Targets

Old Generation (and sometimes entire heap)

Characteristics

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

Example

Consider an online shopping application.

Short-Lived Objects

Stored in

Young Generation

Long-Lived Objects

Stored in

Old Generation

Why Is This Important?

If too many objects are promoted to the Old Generation

Monitoring tools such as

can help analyze memory behavior.

Common Mistakes

Follow-up Questions

Interview Tip

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?

More Core Java - Level II interview questions

All Core Java - Level II questions