• Unity
  • Unload Sprite Atlas from memory

Hi! I have a similar problem, where I load the new scene, where the Atlas is not referenced in any way, but according to the Profiler, it still has a lot of references to it.

This is the code for when I am changing scenes:

await UnloadScene(sceneToUnload);
AtlasUtilities.ClearCache();
await UniTask.Yield();
await Resources.UnloadUnusedAssets();
await BuildScene(sceneToLoad);

When I uninstalled the old scene and performed GC and switched to the new scene, there were still Spine resources of the old scene that were not recovered

Related Discussions
...
  • Изменено

Please note that the references you tracked are a profiler capture from the Unity Editor play mode (as the remark says "Memory usage is the Editor is not the same is it would be in a Player"). We could not yet reproduce such an issue in the built executable. Do you also encounter this behaviour when profiling your built executable?

Harald написал

Please note that the references you tracked are a profiler capture from the Unity Editor play mode (as the remark says "Memory usage is the Editor is not the same is it would be in a Player"). We could not yet reproduce such an issue in the built executable. Do you also encounter this behaviour when profiling your built executable?

I got the same results on my real Android mobile phone

Thanks for getting back to us, sorry to hear that it also occurs on your target device. Could you please send us a minimal Unity project that shows this issue? You can send it as a zip package to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at what's going wrong.

5 дней спустя

Sorry,There's something wrong with the way I unloaded

Thanks for getting back to us. I have seen your new thread here:
Is there a way to release the initial resource.
Let's continue the discussion over there.