Addressables 1.19 Asynchronous Reference Counting Changes Impact Rapid Scene Transitions
22.5K reputation · 17 Apr 2020, 10:26 UTC
Goal: Determine if the asynchronous reference counting in Addressables 1.19 requires an explicit wait before releasing handles during rapid scene transitions to avoid memory retention.
The documentation still recommends the synchronous ReleaseInstance pattern, yet the internal reference count is now decremented asynchronously. When InstantiateAsync and ReleaseInstance are called in quick succession—such as during frequent scene loads—the handle may report a non‑zero count, leaving the instantiated GameObject in memory. This mismatch creates uncertainty about the safe timing for cleanup without introducing frame‑delay overhead.
Questions:
- Should developers wait for AsyncOperationHandle.IsDone (or yield a frame) before calling ReleaseInstance in high‑frequency instantiate/release loops?
- Does the internal reference count eventually reach zero on its own, or is manual intervention required to guarantee timely release?
- Is there a recommended pattern that balances immediate cleanup with the asynchronous counting behavior?