9148c358d0
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 폴더 제거.
4.7 KiB
4.7 KiB
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-incremental-marking | Incremental Marking | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Incremental Marking
매 한 줄
"매 GC mark phase 의 small slice 의 mutator 의 interleave 의 통한 pause time 의 reduction". 매 Dijkstra 의 1978 tri-color abstraction 의 origin, 매 V8 (2011), Go (2015 concurrent), ZGC/Shenandoah (sub-millisecond) 의 modern 의 ubiquity — 매 stop-the-world 의 long pause 의 avoid.
매 핵심
매 Tri-Color Abstraction
- White: 매 unvisited / unreachable candidate.
- Gray: 매 visited 의 children 의 X.
- Black: 매 fully scanned (children 의 gray/black).
- Invariant: 매 black → white edge 의 X (strong invariant) 의 violation 의 fix → write barrier.
매 Write Barrier 종류
- Dijkstra (insertion): black → white 의 store 의 시 white 의 gray 로 promote.
- Yuasa (deletion / SATB): gray pointer 의 overwrite 시 old target 의 gray 로 (snapshot-at-the-beginning).
- Hybrid: Go 1.8+ 의 hybrid barrier (stack 의 black 의 가정).
매 응용
- V8 (Chrome/Node) — incremental + concurrent + lazy sweep.
- Go — concurrent tri-color mark, sub-ms STW.
- JVM ZGC / Shenandoah — colored pointers / load barriers.
💻 패턴
Dijkstra Write Barrier (Pseudo-C)
void write_barrier(Object** slot, Object* new_val) {
if (gc_phase == MARKING && new_val != NULL && new_val->color == WHITE) {
new_val->color = GRAY;
mark_stack_push(new_val);
}
*slot = new_val;
}
Tri-Color Marking Loop
void incremental_mark_step(size_t budget_bytes) {
size_t scanned = 0;
while (scanned < budget_bytes && !mark_stack.empty()) {
Object* obj = mark_stack.pop(); // gray
for (Object* child : obj->refs()) {
if (child->color == WHITE) {
child->color = GRAY;
mark_stack.push(child);
}
}
obj->color = BLACK;
scanned += obj->size();
}
}
V8-Style Step Scheduling
// Allocation 의 통한 mark step 의 trigger
void* allocate(size_t n) {
void* p = bump_alloc(n);
marking_progress_ += n;
if (marking_progress_ >= step_threshold_) {
incremental_mark_step(/*budget=*/n * 2); // pay-as-you-go
marking_progress_ = 0;
}
return p;
}
Go-Style SATB-ish Hybrid Barrier
// runtime/mbarrier.go (simplified)
//go:nowritebarrierrec
func gcWriteBarrier(slot *unsafe.Pointer, ptr unsafe.Pointer) {
if writeBarrier.enabled {
// Shade ptr (Dijkstra) AND shade *slot (Yuasa)
shade(ptr)
shade(*slot)
}
*slot = ptr
}
Concurrent Mark Termination
void mark_termination() {
stop_the_world(); // brief STW
drain_remaining_mark_stack(); // flush per-thread buffers
weak_ref_processing();
start_concurrent_sweep();
resume_world();
}
매 결정 기준
| 상황 | Approach |
|---|---|
| Latency-critical (game, trading) | ZGC / Shenandoah (sub-ms) |
| Throughput-critical (batch) | Parallel STW collector |
| Mid-size heap, mixed | G1, V8 incremental |
| Tiny heap (embedded) | Reference counting / simple mark-sweep |
기본값: 매 modern runtime 의 기본 (V8, Go, JVM G1) — explicit tuning 없이 incremental marking 의 enabled.
🔗 Graph
- 부모: Garbage Collection · Memory Management
- 변형: Concurrent-Marking
- 응용: V8
- Adjacent: Write Barrier · Reference-Counting
🤖 LLM 활용
언제: GC pause 의 root cause 의 analysis, write barrier 의 correctness 의 reasoning, GC log 의 parse. 언제 X: production GC tuning 의 final decision (workload-specific benchmark 필수).
❌ 안티패턴
- Missing write barrier: black → white 의 invariant 의 violation 의 → premature reclamation 의 use-after-free.
- Unbounded step: incremental step 의 budget 의 X → STW-equivalent pause.
- Floating garbage 의 ignore: SATB 의 dead 가 mark, 매 cycle 의 retain — frequent collection 의 통한 mitigation.
- Allocator 의 black allocation 의 fail: marking 중 allocate 의 white → 매 next cycle 까지 reachable 의 보장 의 X.
🧪 검증 / 중복
- Verified (Dijkstra "On-the-fly Garbage Collection" 1978, V8 blog, Go GC design doc, Hudson "A Unified Theory of GC").
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — incremental GC marking 의 full content |