---
title: Incremental Garbage Collection
source: https://dev.epicgames.com/documentation/en-us/unreal-engine/incremental-garbage-collection-in-unreal-engine?application_version=5.7
version: Unreal Engine 5.7 Documentation (5.8 URL not tried separately; experimental feature)
fetched: 2026-10-11
note: 原文摘录（英文要点），供 wiki 引用；非全文
---

# Incremental Garbage Collection

- Experimental. UE uses mark-and-sweep; reachability analysis must complete in a single frame, stopping UObject processing → hitches proportional to object count. Workarounds: tight UObject budgets, pools, disabling GC during gameplay.
- Incremental reachability analysis splits it across frames with per-frame soft time limit; references tracked via TObjectPtr properties — assignment to a TObjectPtr UPROPERTY marks object reachable during GC ("garbage collector write barrier"). Must convert all UPROPERTY raw pointers to TObjectPtr or objects may be reclaimed too early.
- Enable: gc.AllowIncrementalReachability=1, gc.AllowIncrementalGather=1, gc.IncrementalReachabilityTimeLimit=0.002.
- Debug cvars: gc.DelayReachabilityIteration, gc.VerifyNoUnreachableObjects, gc.ContinuousIncrementalGC.
- Known limitation: not fully thread safe; objects manipulated on worker threads may not be marked reachable → premature GC. Recommend single-threaded builds only (e.g. dedicated servers).
