Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Garbage Collection of Oracle JDK6

Garbage Collection of Oracle JDK6

A simple introduction for GC, mainly about Oracle JDK6.

Kengo TODA

June 13, 2012

More Decks by Kengo TODA

Other Decks in Technology


  1. Summary for previous Object size = size of header +

    Σ (field). Array requires contiguous space to store. Why we have to care? 12೥6݄12೔Ր༵೔
  2. What’s GC? Memory management algorithm The reason why we don’t

    have to `free` in Java 12೥6݄12೔Ր༵೔
  3. Type of GC Mark and sweep garbage collection Copying garbage

    collection Generational garbage collection Garbage first garbage collection (G1GC) etc. 12೥6݄12೔Ր༵೔
  4. Currently we use... Generational garbage collection with copying GC for

    new generation with mark & sweep GC for old generation 12೥6݄12೔Ր༵೔
  5. What is Generation? Divide heap into 4 areas Tenured area

    is ‘old generation’ and others belongs to ‘new generation’ Survivor 1 Survivor 2 Eden Tenured new old 12೥6݄12೔Ր༵೔
  6. What is Generation? All data are stored in Eden area

    at 1st Data is moved by GC Survivor 1 Survivor 2 Eden Tenured new old 12೥6݄12೔Ր༵೔
  7. What is Generation? Object data cannot span border If there

    is no space to put data in specified area, we have to boot GC to keep space Survivor 1 Survivor 2 Eden Tenured new old NG OK OK 12೥6݄12೔Ր༵೔
  8. key point Long contiguous space is danger because Throw OOME

    if it’s longer than heap area (not whole heap size) Boot GC and slow JVM 12೥6݄12೔Ր༵೔