[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,93 +2,134 @@
|
||||
id: wiki-2026-0508-orinoco-프로젝트
|
||||
title: Orinoco 프로젝트
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-6EB2FE]
|
||||
aliases: [Orinoco, V8 Orinoco]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
tags: [auto-reinforced]
|
||||
verification_status: applied
|
||||
tags: [v8, gc, performance]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
github_commit: "[P-Reinforce] Continuous Worker - [[Orinoco]] 프로젝트"
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: C++
|
||||
framework: V8 12+
|
||||
---
|
||||
|
||||
# [[Orinoco 프로젝트]]
|
||||
# Orinoco 프로젝트
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> Orinoco 프로젝트는 V8 [[JavaScript]] 엔진의 가비지 컬렉터(GC)를 최신 기술로 개선하기 위해 진행된 프로젝트의 코드명입니다 [1-3]. 이 프로젝트는 기존의 순차적이고 모든 실행을 멈추는 '[[Stop-the-world]]' 방식의 가비지 컬렉터를 병렬(parallel), 동시(concurrent), 점진적(incremental) 기술을 활용하는 형태로 진화시켰습니다 [1, 2, 4]. 주된 목적은 메인 스레드의 부하를 덜어주어 가비지 컬렉션으로 인한 프로그램 중지 시간(pause time)을 최소화하고 사용자 경험을 향상시키는 것입니다 [2, 5].
|
||||
## 매 한 줄
|
||||
> **"매 V8 의 GC 의 mostly-parallel, mostly-concurrent 의 evolution"**. 2016 발표된 Orinoco initiative 가 V8 의 stop-the-world phase 를 minimize — incremental marking, parallel scavenge, concurrent sweeping, compaction 의 background offload. 2026 현재 V8 12+ 의 default. Main thread pause time 이 100ms+ → sub-10ms 로 reduce.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **GC 모델의 현대화:** Orinoco는 기존의 'stop-the-world' 중지 방식을 벗어나, 동시적이고 병렬적이며 점진적인 GC 모델로의 전환을 의미합니다 [1, 4]. 이를 위해 스마트 페이징과 동시성 친화적 알고리즘을 도입하여 '구 세대(Old Generation)'와 '신 세대(Young Generation)' 가비지 컬렉터를 병렬화했습니다 [5].
|
||||
- **병렬(Parallel) 기법 도입:** 메인 스레드와 다수의 헬퍼 스레드가 동시에 거의 동일한 양의 작업을 수행하도록 처리합니다 [2]. 이 역시 실행을 일시 중지하는 방식이지만, 동기화에 필요한 약간의 오버헤드를 제외하면 전체 중지 시간을 참여하는 스레드의 수만큼 나누어 크게 줄일 수 있습니다 [2].
|
||||
- **점진적(Incremental) 마킹:** 마킹 작업을 아주 작은 덩어리로 나누어 JavaScript 실행 중간중간에 교차로 배치(interleave)하는 방식입니다 [6, 7]. 이 방식은 총 GC 시간을 줄이지는 못하지만 긴 중지 시간을 잘게 분산시킴으로써, 애플리케이션이 끊김 없이 사용자 입력이나 애니메이션에 반응할 수 있도록 돕습니다 [6, 7].
|
||||
- **동시(Concurrent) 처리:** 메인 스레드가 멈추지 않고 JavaScript를 실행하는 동안, 백그라운드의 헬퍼 스레드들이 GC 작업을 전담하여 처리합니다 [8]. 객체의 상태가 언제든 변할 수 있어 읽기/쓰기 경합(read/write races)을 처리해야 하는 가장 복잡한 기술이지만, 메인 스레드를 온전히 자유롭게 해방시킬 수 있습니다 [8].
|
||||
- **프로젝트의 성과 및 확장:** Orinoco 프로젝트를 통해 많은 GC 작업이 백그라운드로 이동하면서 지연 시간과 페이지 로딩 성능이 비약적으로 향상되었으며, 스크롤이나 애니메이션이 훨씬 부드러워졌습니다 [9]. 더 나아가, 여기서 개발된 새로운 기술의 일부는 [[Chrome]]의 렌더러([[Blink]])에 내장된 가비지 컬렉터인 '[[Oilpan]]'으로 이식하여 협력을 개선하는 작업도 진행 중입니다 [10].
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 자동화 엔진에 의해 매핑된 지식으로, 추후 정밀 검증 필요.
|
||||
- **정책 변화:** Programming & Language 분야의 자동 자산화 수행.
|
||||
### 매 design pillars
|
||||
- **Parallelism**: 동시 main thread 를 멈추고 worker thread 다수 사용 (parallel scavenge, parallel compaction).
|
||||
- **Concurrency**: main thread 는 mutator 의 user code 실행, GC thread 가 background marking/sweeping.
|
||||
- **Incremental**: long pause 를 작은 step 으로 split, frame 사이 의 짤끔.
|
||||
- **Idle-time GC**: main thread idle window (rAF gap) 의 활용.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- **Related Topics:** [[V8 Engine]], [[Garbage Collection]] (GC), [[Stop-the-world]], [[Incremental Marking]]
|
||||
- **Projects/Contexts:** [[Oilpan]], [[Blink]]
|
||||
- **Contradictions/Notes:** 소스에 관련 정보가 부족합니다. (소스 내에서 Orinoco 프로젝트에 대한 상충되는 주장은 발견되지 않습니다.)
|
||||
### 매 collector phases
|
||||
- **Young (Scavenger)**: parallel copying, 보통 <1ms.
|
||||
- **Old marking**: incremental + concurrent (mutator 동시 실행).
|
||||
- **Old sweeping**: concurrent free-list rebuild.
|
||||
- **Old compaction**: parallel evacuation, 매 page-level.
|
||||
- **Write barrier**: 매 mutator 가 mark 와 race 의 prevent.
|
||||
|
||||
---
|
||||
*Last updated: 2026-04-19*
|
||||
### 매 응용
|
||||
1. Chrome / Edge / Brave (V8 host).
|
||||
2. Node.js / Deno / Bun (runtime GC 의 같은 Orinoco 기반, Bun 은 JSC 라 다름).
|
||||
3. Electron, VS Code (V8 backend).
|
||||
|
||||
---
|
||||
## 💻 패턴
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### Orinoco trace 보기
|
||||
```bash
|
||||
node --trace-gc --trace-gc-verbose app.js
|
||||
# [Mark-Compact (incremental) ...]
|
||||
# [Scavenge (parallel) ...]
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### Heap stats with v8 module
|
||||
```javascript
|
||||
const v8 = require('v8')
|
||||
const stats = v8.getHeapStatistics()
|
||||
console.log({
|
||||
used: stats.used_heap_size,
|
||||
total: stats.total_heap_size,
|
||||
limit: stats.heap_size_limit,
|
||||
})
|
||||
const spaces = v8.getHeapSpaceStatistics()
|
||||
spaces.forEach(s => console.log(s.space_name, s.space_used_size))
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### Triggering Orinoco-friendly allocation
|
||||
```javascript
|
||||
// O — short-lived 의 young space 에 머무름
|
||||
function processBatch(items) {
|
||||
return items.map(i => ({ id: i.id, val: i.val * 2 })) // returns die fast
|
||||
}
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
// X — large pre-allocated buffer 의 old promotion 강제
|
||||
const giant = new Array(1e7).fill(0) // bypasses young entirely
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### --max-old-space-size tuning
|
||||
```bash
|
||||
node --max-old-space-size=4096 app.js # 4GB old space ceiling
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### Idle-time GC hint
|
||||
```javascript
|
||||
// Chrome internal — webpages cannot directly trigger,
|
||||
// but rAF-aligned work 의 GC 가 idle gap 을 활용
|
||||
requestIdleCallback((deadline) => {
|
||||
while (deadline.timeRemaining() > 0 && tasks.length) doWork(tasks.pop())
|
||||
})
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### Heap snapshot diff
|
||||
```javascript
|
||||
const v8 = require('v8'); const fs = require('fs')
|
||||
v8.writeHeapSnapshot('before.heapsnapshot')
|
||||
runWorkload()
|
||||
v8.writeHeapSnapshot('after.heapsnapshot')
|
||||
// Chrome DevTools → Memory → Comparison
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Browser frame budget (16.6ms) | Orinoco 의 default 충분 |
|
||||
| Large heap (4GB+) | --max-old-space-size + monitoring |
|
||||
| Latency-critical (game, RT) | Object pool + young-friendly allocation |
|
||||
| Server long-running | --gc-interval + heap dump 주기 |
|
||||
|
||||
**기본값**: 매 V8 default Orinoco + workload 의 short-lived bias.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[V8 엔진 힙 아키텍처]]
|
||||
- 변형: [[Orinoco 가비지 컬렉터]]
|
||||
- 응용: [[Incremental Marking]] · [[Mark-Sweep-Compact 알고리즘]]
|
||||
- Adjacent: [[Generational Hypothesis]] · [[Old Space]] · [[Write Barrier]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: V8 GC 의 internals 설명, Node.js / Chrome heap tuning, `--trace-gc` 분석.
|
||||
**언제 X**: 다른 engine (JSC, SpiderMonkey, Hermes) 의 GC.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **`global.gc()` 강제**: 매 production 의 X. Orinoco 가 의 better job 의 함.
|
||||
- **--expose-gc 의 production**: 매 attack surface 와 perf degradation.
|
||||
- **Heavy sync work**: incremental marking 의 main thread 가 idle 해야 진행 → tight loop 의 GC 의 starve.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (V8 blog "Orinoco" 2016, "Concurrent marking" 2017, V8 12.x release notes).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Orinoco design pillars + tracing patterns |
|
||||
|
||||
Reference in New Issue
Block a user