"매 young object 의 매 빠른 die — 매 cheap 하게 collect". Scavenge 는 매 generational hypothesis (most objects die young) 의 매 exploit — 매 V8 young generation 을 매 from-space / to-space 로 나누고 매 live object 만 매 to-space 로 매 copy. 매 dead object 는 매 단순 abandon. 2026 V8 (Orinoco) 에서 매 parallel + concurrent 로 매 main-thread pause < 1ms.
매 핵심
매 Cheney's algorithm
Allocate in to-space (linear bump pointer).
When full → 매 swap roles. From-space = 매 old to-space.
From roots, copy 매 reachable object to (new) to-space.
Update 매 forwarding pointer in from-space slot.
BFS through copied objects, copying 매 referenced objects.
Done → from-space 매 entirely abandoned.
매 V8-specific
Young gen = New Space ≈ 1–8 MB per worker.
Promotion: 매 survives 2 scavenges → 매 Old Space.
Parallel Scavenge (2018+): 매 multiple threads.
Concurrent (2021+): root marking on background.
매 응용
JS heap young gen.
Java HotSpot Young Generation (Parallel Scavenge collector).
if(obj_age(o)>=2){void*promoted=alloc_old(obj_size(o));memcpy(promoted,o,obj_size(o));// also update remembered set if old → young pointers exist
}else{scavenge_copy(o);inc_age(o);}
언제: GC log analysis, allocation hotspot identification from heap snapshots, write-barrier overhead estimation.
언제 X: 매 actual GC algorithm change — runtime team only.
❌ 안티패턴
Massive young alloc + immediate retain: 매 promotion storm → 매 old space pressure.
Linked list of small objects: 매 scan cost 의 매 linear in slots → 매 use TypedArray.
Disabling GC: 매 --no-gc — 매 memory grows unbounded.