a: (refcount=1, is_ref=0)=class stdClass { } b: (refcount=1, is_ref=0)=class stdClass { } a: (refcount=2, is_ref=0)=class stdClass { ... } b: (refcount=2, is_ref=0)=class stdClass { ... } a: (refcount=2, is_ref=0)=class stdClass { …. } b: no such symbol a: no such symbol b: no such symbol
VM Heap VM Stack From To Eden Survivor New ( Nursery ) Old ( Tenured ) Permenent Java メモリ管理 Java には多くの GC 機構が取り入れられている • 世代別 GC • コピー GC / コンパクション • マークスイープ GC
VM Heap VM Stack From To Eden Survivor New ( Nursery ) Old ( Tenured ) Permenent GC の仕組み Minor Garbage Collection (1) 不要データを削除 (2) 必要データを Eden → To に移動
VM Heap VM Stack From To Eden Survivor New ( Nursery ) Old ( Tenured ) Permenent GC の仕組み Minor Garbage Collection (1) To → From を入れ替える (2) 不要データを削除 (3) 必要データを Eden / From → To に移動
VM Heap VM Stack From To Eden Survivor New ( Nursery ) Old ( Tenured ) Permenent GC の仕組み Minor Garbage Collection (1) To → From を入れ替える (2) 不要データを削除 (3) 必要データを Eden / From → To に移動 (4) 年齢が一定に達したものを Old に移動
VM Heap VM Stack From To Survivor New ( Nursery ) Permenent GC の仕組み Full Garbage Collection • Old へのメモリ割り当てが失敗した場合 • Young / Old 両方を対象とした回収処理 • Old からの退避領域はないため特殊な GC Eden Old ( Tenured )