## Notas
- Objects are stored in heap memory
- **Young Generation** is where newly-created objects are stored
- Specifically in **eden space**
- When it becomes full, **minor GC** occurs
- **Minor GC**
- Objects that are referenced are moved to S0 (in survivor space)
- Unreferenced objects are cleared out by GC
- Only happens in **Young Generation**
- When **Minor GC** is triggered again
- Objects that survive in **eden** and **S0** are moved to **S1**
- Get tagged with an age counter; this is a threshold for moving objects to **Old Generation**
- Other invocations of **Minor GC**
- Objects in **eden** and **S1** are moved to **S0**
- Basically **S0** and **S1** are used every other time, and objects are moved back and forth
- **Old Generation**
- When objects are collected from **Old Generation**, it triggers a **Major GC** event
- Also known as **Tenured Generation**
- **Major GC**
- Only happens in **Old Generation** space
- **Permanent Generation**
- Initially populated by JVM with metadata that represents classes & methods of the application at runtime
![[java-heap-memory.png]]
## Brainstorm Flashcard Creation
- What are the parts of heap memory
- What is Young Generation
- What is Old Generation
- What is Permanent Generation
- What is Minor Garbage Collection
- What is Major Garbage Collection
- What is Eden Space
- What is Survivor Space
- What is Tenured Generation
## References
- [Java Memory Management, Understanding the JVM Heap Method Area - Medium](https://medium.com/@khurshidbek-bakhromjonov/java-memory-management-understanding-the-jvm-heap-method-area-stack-24a4d4fa2363)
- [[(java) What are the parts of heap memory]]
- [[(java) What is Young Generation]]
- [[(java) What is Old Generation]]
- [[(java) What is Permanent Generation]]
- [[(java) What is Minor Garbage Collection]]
- [[(java) What is Major Garbage Collection]]
- [[(java) What is Eden Space]]
- [[(java) What is Survivor Space]]
- [[(java) What is Tenured Generation]]