id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
id
title
category
status
canonical_id
aliases
duplicate_of
source_trust_level
confidence_score
verification_status
tags
raw_sources
last_reinforced
github_commit
tech_stack
wiki-2026-0508-old-space
Old Space (V8)
10_Wiki/Topics
verified
self
Old Generation
Tenured Space
V8 Old Space
Major GC heap
none
A
0.95
applied
v8
gc
memory
javascript
runtime
2026-05-10
pending
language
framework
javascript
v8
Old Space (V8)
매 한 줄
"매 V8 heap의 long-lived object 영역 — Young Gen에서 2번 생존 후 promote, Major GC (Mark-Compact / Mark-Sweep / Concurrent Marking) 대상." . Generational hypothesis 기반 (Ungar 1984). 2026 현재 V8 13.x · Node 24 · Chrome 130+에서 Orinoco의 concurrent / parallel / incremental marking + Pointer Compression으로 pause time <1ms.
매 핵심
매 V8 heap 구조
New Space (Young Gen) : 1-8MB, semi-space (Cheney scavenger), allocation 빠름.
Old Space (Old Gen) : 매 default unbounded (--max-old-space-size 제한), promote target.
Code Space : JIT compiled code.
Map Space : Hidden class (V8 maps).
Large Object Space : ≥ ~256KB single object.
Read-Only Space : immutable roots.
매 promotion 규칙
매 Young Gen에서 minor GC 2번 survive → Old Space promote.
Large object (≥ kMaxRegularHeapObjectSize, ~256KB) → 직접 Old Space (LOS).
매 Major GC (Old Space) 알고리즘
Mark-Compact : full pause, fragmentation 제거.
Concurrent Marking (Orinoco): worker thread가 mark, main thread continue.
Incremental Marking : chunk별 mark, 사이사이 mutator 실행.
Lazy Sweeping : page별로 sweep on demand.
매 응용
Node.js server — heap profiling으로 leak 추적 (--inspect, heapdump).
Chrome — DevTools Memory tab의 retained size 분석.
Performance tuning — --max-old-space-size=4096로 limit 조정.
💻 패턴
Heap snapshot 생성 (Node.js)
Inspect heap stats
Force GC for measurement (--expose-gc)
Trace GC events
Monitor old space in production (Prometheus)
Avoid old-space leak — WeakRef / WeakMap for cache
매 결정 기준
상황
Approach
Suspected memory leak
heap snapshot diff
OOM under load
--max-old-space-size= increase + investigate
Frequent major GC pause
reduce promotion rate (avoid long-lived churn)
Cache growing forever
WeakMap / LRU bound
Need pre-prod heap profile
--inspect + DevTools
기본값 : 매 default V8 settings — limit 변경은 측정 후.
🔗 Graph
🤖 LLM 활용
언제 : Node.js memory issue 분석, heap profiling, V8 internals 학습, GC tuning.
언제 X : non-V8 runtime (Bun-JSC, Deno-V8 다르지만 비슷, Hermes는 별도), browser-only DOM leak (different territory).
❌ 안티패턴
Forgotten timer/listener : 매 closure가 old space에 retain.
Global cache without bound : 매 monotonic growth → OOM.
Large allocation in hot loop : Young → Old promotion 폭증, frequent major GC.
String concat in loop without builder : 매 intermediate retained.
--max-old-space-size blindly raised : 매 leak hide, root cause 회피.
🧪 검증 / 중복
Verified (V8 source v8/src/heap/, V8 blog Orinoco posts, Node.js v8 module docs 2026).
신뢰도 A.
Duplicates: Old_Space(Old_Generation).md redirects here.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — canonical V8 Old Space doc + heap profiling patterns