Tag: Memory & Garbage Collection
All the articles with the tag "Memory & Garbage Collection".
Observer Pattern in Unity: Instance Class or Static Class?
Why choosing a static class for an Observer system just to skip instance management does not prevent memory issues: Dissecting MulticastDelegate GC Root retention, Domain Reload traps, and lifecycle-driven scoping.
MaterialPropertyBlock Prevents Material Duplication, So Why Does It Break the SRP Batcher?
Migrating from Built-in to URP with MaterialPropertyBlock to stop material leaks often disables the SRP Batcher in Frame Debugger: How UnityPerMaterial CBUFFER layouts conflict with per-renderer overrides and practical alternatives.
Renderer.material vs Renderer.sharedMaterial: Memory Leak Traps, Broken Batching, and the MaterialPropertyBlock Solution
A casual renderer.material.color call can destroy your game performance: spawning hidden Material copies in RAM, multiplying Draw Calls, and leaking C++ native memory. Discover the engine internals and optimal MaterialPropertyBlock techniques.
Coroutine, C# Task, UniTask, or Awaitable (Unity 6): Execution Internals, Threading, and Memory Management
Using standard C# Tasks in gameplay loops triggers Main Thread crashes and heap allocation. Runtime internals, UniTask zero-alloc struct pooling, and Unity 6 native Awaitable threading.
Why RAM Does Not Drop After Scene Transitions in Addressables: A Profiler Leak Tracing Guide
Unloading a scene yet native RAM on the Profiler remains pegged at peak usage: Lifecycle decoupling between scenes and AsyncOperationHandles, with a 3-step leak tracing procedure.
Addressables Reference Counting: Why Object.Destroy Fails to Free Memory
Destroying GameObjects leaves native RAM unchanged due to Addressables two-tier reference counting. Bundle-level asset pinning mechanics and how to pair Addressables safely with Object Pooling.