docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
---
|
||||
id: wiki-2026-0508-orinoco
|
||||
title: Orinoco (V8 GC project)
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [V8 Orinoco, Orinoco GC, Concurrent V8 GC]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [v8, gc, performance, concurrent-marking, runtime]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: cpp
|
||||
framework: v8
|
||||
---
|
||||
|
||||
# Orinoco
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 V8의 GC를 stop-the-world에서 incremental · concurrent · parallel multi-threaded GC로 전환한 multi-year 프로젝트."**. 2016년 시작, 2017-2019 Concurrent Marking · Parallel Scavenger · Lazy Sweeping 차례 도입. 2026 현재 V8 13.x base GC architecture가 Orinoco — pause time을 100ms+ → <1ms로 감소.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 핵심 기법
|
||||
- **Parallel Scavenger** (Young Gen): 매 multiple worker가 semi-space copy 병렬화.
|
||||
- **Concurrent Marking** (Old Gen): 매 worker thread가 mutator와 병행 mark — main thread는 거의 미 pause.
|
||||
- **Incremental Marking**: 매 mark phase를 여러 작은 chunk로 나눔.
|
||||
- **Parallel/Concurrent Compaction**: page별 evacuation 병렬화.
|
||||
- **Lazy Sweeping**: 매 sweep을 allocation 시점까지 지연.
|
||||
- **Black Allocation**: 매 marking 중 새 alloc은 black (skip).
|
||||
|
||||
### 매 write barrier 역할
|
||||
- 매 mutator가 마크된 object → 비마크 object 참조 추가 시 dirty card 표시.
|
||||
- 매 concurrent marker가 stale graph 처리.
|
||||
|
||||
### 매 응용
|
||||
1. Chrome — main thread jank 감소, smooth 60fps scroll.
|
||||
2. Node.js — large heap server에서 long pause 제거.
|
||||
3. Electron/VSCode — GUI responsiveness 유지.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Orinoco effect 측정 (Node.js)
|
||||
```bash
|
||||
# Major GC pause 분포
|
||||
node --trace-gc --trace-gc-verbose app.js 2>&1 \
|
||||
| grep "Mark-" | awk '{print $5}' \
|
||||
| sort -n | uniq -c
|
||||
# 2026 V8: 대부분 < 1ms, occasional 5ms
|
||||
```
|
||||
|
||||
### Disable concurrent marking (compare)
|
||||
```bash
|
||||
node --no-concurrent-marking --trace-gc app.js
|
||||
# pause time 명백히 증가 (10-50ms 종종)
|
||||
```
|
||||
|
||||
### Per-isolate GC stats
|
||||
```javascript
|
||||
import { getHeapStatistics } from 'node:v8';
|
||||
|
||||
const before = getHeapStatistics();
|
||||
heavyWorkload();
|
||||
const after = getHeapStatistics();
|
||||
console.log('major_gc count:', after.number_of_native_contexts);
|
||||
console.log('used:', (after.used_heap_size - before.used_heap_size) / 1e6, 'MB');
|
||||
```
|
||||
|
||||
### Performance.measureUserAgentSpecificMemory (Chrome)
|
||||
```javascript
|
||||
// In Chrome with COOP+COEP
|
||||
if (performance.measureUserAgentSpecificMemory) {
|
||||
const result = await performance.measureUserAgentSpecificMemory();
|
||||
console.log(result.bytes, result.breakdown);
|
||||
}
|
||||
```
|
||||
|
||||
### Reduce concurrent-marking pressure
|
||||
```javascript
|
||||
// Avoid: huge graph mutation in tight loop
|
||||
function reseat(arr, n) {
|
||||
for (let i = 0; i < n; i++) arr[i] = { ref: arr[(i+1) % n] };
|
||||
// many write barriers → marker work spike
|
||||
}
|
||||
// Prefer: build once, freeze
|
||||
const frozen = Object.freeze(buildGraph());
|
||||
```
|
||||
|
||||
### Inspect GC marking phase via perf_hooks
|
||||
```javascript
|
||||
import { PerformanceObserver } from 'node:perf_hooks';
|
||||
|
||||
const obs = new PerformanceObserver(list => {
|
||||
for (const e of list.getEntriesByType('gc')) {
|
||||
if (e.detail.kind === 2 /* MARK_SWEEP_COMPACT */)
|
||||
console.log('major GC:', e.duration.toFixed(2), 'ms');
|
||||
}
|
||||
});
|
||||
obs.observe({ entryTypes: ['gc'] });
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Long pause complaint (UI jank) | check Orinoco enabled (default), profile |
|
||||
| Embedded V8 (custom flags) | enable concurrent + incremental marking |
|
||||
| Constrained memory (IoT) | might disable concurrent (extra worker thread) |
|
||||
| Benchmarking | report w/ default flags + GC trace |
|
||||
|
||||
**기본값**: 매 default flags (Orinoco on) — 매 manual disable 회피.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Garbage_Collection]] · [[V8 엔진 힙 아키텍처|V8 Heap Architecture]]
|
||||
- 변형: [[Incremental_Marking]] · [[Concurrent_Marking]] · [[Mark-Sweep]]
|
||||
- 응용: [[Old_Space]] · [[Pointer_Compression]] · [[Write Barrier|Write_Barrier]]
|
||||
- Adjacent: [[Generational_Hypothesis]] · [[Snapshots]] · [[Multi-threaded Architecture]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: V8 GC internals 학습, Node.js/Chrome perf 분석, GC pause 회귀 추적.
|
||||
**언제 X**: non-V8 runtime (Hermes는 별도 GC), Java/Go GC (G1/ZGC/Shenandoah는 다른 design).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Disabling concurrent marking blindly**: 매 measurement 없이 — 보통 perf 악화.
|
||||
- **Huge mutation in hot loop**: 매 write barrier overload.
|
||||
- **Forcing `global.gc()` 빈번**: 매 production 절대 X — Orinoco가 알아서 함.
|
||||
- **Confusing minor (scavenge) and major (mark-sweep)**: 매 trace 해석 오류.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (V8 blog "Orinoco" series 2016-2019, V8 source `src/heap/`, Mathias Bynens & Benedikt Meurer talks 2017-2020).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Orinoco GC project (concurrent/parallel/incremental) |
|
||||
Reference in New Issue
Block a user