Hi there, I’ve been integrating the Addressables system to out content management and loading system and I’ve noticed a worrying pattern when I’ve started using the Load and Unload scene mechanic.
Our system works by creating load tasks for all items we might need in a given scenario, then processing loading and displaying the given content. When we’re done we unload all of the items.
We don’t have any issues with regular assets loaded trough Addressables, they get nicely cleared out at the end.
With the scenes though, for each loaded scene that gets unloaded, we get a leftover handle in the Addressable Profiler UnityEngine/ResourceManagement.ResourceProviders.SceneProvider+UnloadSceneOp, result'', status='None'.
This also stays in the profiler when loading a scene with LoadMethod.Single to unload all previously loaded scenes.
Is there a way to properly cleaned up? Or am I doing something wrong?
As of 1.2.2 there is a parameter in the UnloadScenes call that can optionally make these operations auto-unload…
public static AsyncOperationHandle<SceneInstance> UnloadSceneAsync(SceneInstance scene, bool autoReleaseHandle = true)
Are you calling that with false? Or calling it with true (or default) and it still never goes away? Or perhaps you are using a version older than 1.2.2?
@unity_bill I am on 1.3.8 and I have tried it with both true and false and it has the same effect.
When using false I even attempted to manually call Release on the handle and again, same result.
Correct me if I’m wrong but it seems like that autorelease actually releases the previously loaded scene using LoadSceneAsync. It doesn’t seem to release the actual UnloadSceneAsync handle. I don’t really know how that works, is it supposed to release both?
@techmage I’ve done pretty extensive memory testing with this issue and it doesn’t seem to affect much. If there is a memory leak, its suuuuper slow and will take thousands of unloads to cause any issues.