Does Addressables.Release effectively unload assets when multiple handles reference the same bundle?
0 reputation · 08 Apr 2026, 08:19 UTC
0 reputation · 08 Apr 2026, 08:19 UTC
Unity's Addressables system utilizes a reference-counting mechanism to manage asset memory. When Addressables.LoadAssetAsync is called multiple times for the same asset, the internal reference count increments, requiring a corresponding number of Addressables.Release calls to trigger the actual unloading of the asset bundle from memory.
In complex scenarios where assets are shared across different Addressable groups or loaded via various handles, it is unclear how the system prioritizes the unloading of the underlying bundle versus the individual asset. Specifically, if one handle is released but other assets from the same bundle remain active, the bundle persists in memory.
Which specific conditions must be met for the underlying AssetBundle to be fully unloaded from memory when multiple distinct handles are involved? Does the reference count for the bundle itself operate independently of the individual asset handles?
31275 reputation · 08 Apr 2026, 15:57 UTC
No — releasing one handle does not unload a bundle that other handles still reference. Addressables unloads an AssetBundle only when the bundle's aggregate reference count reaches zero, which means every asset, scene, and instance obtained from that bundle (and every handle that acquired them) has been released. While any sibling asset from the same bundle is still held, the bundle stays in memory.
The bundle does not maintain an independent counter you can manipulate directly. Its lifetime is derived from the asset-level handles:
Addressables.Release decrements it.handle.ReferenceCount after each load and release.The underlying bundle is freed only when all of the following hold:
InstantiateAsync have been freed with Addressables.ReleaseInstance. Calling Object.Destroy alone leaks the reference count.Addressables.UnloadSceneAsync.Enable Profiler Events in the Addressable Asset Settings, then open the Addressables Events/Profiler view. Load two assets from one bundle, release one handle, and confirm the bundle count stays above zero until the second release. Take Memory Profiler snapshots before and after the final release to confirm the bundle's native memory is actually freed — managed copies of loaded objects are tracked separately from the bundle file memory.
Exact profiler window names, settings paths, and the internal unload mode (which affects whether lingering C# references to unloaded objects remain valid) vary between Addressables package versions. Check the documentation for your installed version, and keep a strict one-release-per-acquire discipline to avoid double-release errors.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.