Wednesday, December 28, 2016

Java Heap Memory

At runtime the Java instances are stored in the heap memory. When an object is no longer referenced it becomes deserved for removal from heap memory. During garbage collection process, those objects are removed from heap memory and the space is reclaimed. Heap memory has three major areas,
  1. Young Generation
    1. Eden Space (any instance enters the runtime memory area through eden)
    2. S0 Survivor Space (older instances moved from eden to S0)
    3. S1 Survivor Space (older instances moved from S0 to S1)
  2. Old Generation (instances promoted from S1 to tenured)
  3. Permanent Generation (contains meta information like class, method detail) 

No comments:

Post a Comment