Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 1.08 KB

Memory Management.md

File metadata and controls

28 lines (18 loc) · 1.08 KB

Memory Concepts in Java:

Memory Management is all about Garbage Collection i.e. GC in java

GC runs on Heap memory.

Heap Memory is bifurcated into following memory segments:

  1. Young Generation
    • Eden Space
    • Survivor Space 1
    • Survivor Space 2
  2. Old Generation

image

PremGen: MetaData information of classes was stored in PremGen (Permanent-Generation) memory type before Java 8.
PremGen is fixed in size and cannot be dynamically resized. It was a contiguous Java Heap Memory.

MetaSpace: Java 8 stores the MetaData of classes in native memory called 'MetaSpace'.
It is not a contiguous Heap Memory and hence can be grown dynamically which helps to overcome the size constraints.
This improves the garbage collection, auto-tuning, and de-allocation of metadata

image

Reference: