Scene Unload operations not being cleared

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?

Regards,
Jakub

1 Like

Confirming this on my end too with Addressables v1.3.8 (and Unity v2019.3.0b8)

Ditto

Yeah there has been a few posts about this issue, I dont think any of them have gotten a response from a unity person yet.

Ya I have this issue too. Whats going on?

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?

We’ll look into it. If you could file a ticket against Unity with a repro case, that would help.

1 Like

I am on the latest addressable and autoReleaseHandle is set, but it still has the issue.

We are seeing this as well.

Just upgraded to 1.5.0 and it still shows this?

Am getting close to release, am worried is this a real memory leak?

@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.

Any updates on this issue? Because I also noticed the unreleased unload operation.

This should hopefully be fixed in 1.6.3. If you’re still having trouble let me know.

1.6.2 seems to be the latest available?

@cg-adam sorry, yes 1.6.3 isn’t out just yet but should be soon.

1 Like