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-object-pooling
Object Pooling
10_Wiki/Topics
verified
self
Object Pool
Pool Pattern
Resource Pool
none
A
0.9
applied
performance
memory
gamedev
design-pattern
gc
2026-05-10
pending
language
framework
cpp-csharp-typescript
unity-unreal
Object Pooling
매 한 줄
"매 expensive-to-create object를 미리 만들어두고 재사용하여 alloc/free latency · GC pressure를 제거." . 1990s 게임에서 bullet/particle GC spike 회피로 시작. 2026 현재 Unity ObjectPool<T>, Unreal pooling subsystem, .NET ArrayPool<T>, Netty Recycler 등 plat-form 표준.
매 핵심
매 동작 원리
Pool이 N개 instance 미리 alloc.
acquire() → free list에서 pop.
사용 후 release() → reset 후 free list에 return.
Pool 부족 시 grow (또는 block / fail).
매 적합한 대상
매 alloc cost 큼 (network connection, thread, GPU buffer).
매 빈번한 short-lived alloc (bullet, particle, packet).
매 size predictable.
매 reset 가능 (no permanent dirty state).
매 응용
Game — bullets, enemies, particles, audio sources.
Networking — DB connection pool (HikariCP), HTTP client (Apache).
Rendering — command buffer pool, descriptor set pool (Vulkan).
💻 패턴
C# Unity ObjectPool (2026 standard)
C++ template pool with free-list
TypeScript pool for Web/Node
.NET ArrayPool — GC-friendly buffer reuse
Connection pool (HikariCP idiom in Java)
매 결정 기준
상황
Approach
GC spike from short-lived alloc
object pool
Network/DB resource
connection pool
Render commands
per-frame pool, reset on frame end
Variable size buffer
ArrayPool / segregated pool
Single-threaded game
simple stack pool
Multi-threaded
ConcurrentBag / lock-free pool
기본값 : 매 platform 제공 pool 사용 (Unity ObjectPool, ArrayPool, HikariCP) — 매 직접 구현 회피.
🔗 Graph
🤖 LLM 활용
언제 : GC pressure visible (frame spike), expensive resource creation, predictable churn rate.
언제 X : long-lived object, unique-per-instance state, alloc rate 낮음 — 매 premature opt.
❌ 안티패턴
Forget release : 매 leak — using/try-finally/RAII.
Use after release : 매 use-after-free 등가 — generational handle 사용.
Dirty state carry-over : 매 reset 누락 — bug.
Unbounded growth : 매 maxSize 없음 → OOM.
Premature pooling : 매 GC가 충분히 빠른 경우 — measure first.
🧪 검증 / 중복
Verified (Game Programming Patterns by Nystrom 2014, Unity docs 2026, .NET ArrayPool source, HikariCP).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — Object pooling pattern (4 lang impls + decision matrix)