Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Unity do not unload from memory after Additive scene was unloaded?

Discussion in 'Web' started by battou, Jan 24, 2023.

  1. battou

    battou

    Joined:
    Jan 25, 2011
    Posts:
    213
    Hi. Im facing a problem with our WebGL project. We are using Addressables to load and unload scenes additively to add or remove parts of content. We also always have one scene loaded ontop of whitch other scenes are loading. This scene is always loaded and do not get unloaded.

    So the problem is that in time with more and more scenes being loaded additively and unloaded memory usage grows and never go down.

    We use Addressables UnloadSceneAsync to unload scene and tried to call Resources.UnloadUnusedAssets, but memory usage still constantly goes un with every scene load.

    In Chrome in memory snapshot bulk of the memory usage is in system/JSArrayBufferData. It starts from 180 MB and goes up until it ia the size of all assets of our project, around 800 MB.

    We using Unity 2021.3.0f1

    Is this a bug? Or do we need to do something else to clean up the memory?