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

Loading a scene causes RAM spike and gets app killed

Discussion in 'Addressables' started by Patrick_PS, Feb 4, 2020.

  1. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    Hi,
    Loading a UI scene as addressable causes the GfxDriver Memory to increase from 25MB to 0,78GB in Android builds and the game gets killed by the OS. The same problem occurs with iOS builds.
    memoryGoesBoum.JPG

    I do not call any addressables method before calling Addressables.LoadSceneAsync. Should I be doing something beforehand?

    The scene in question does not have a label. Could the addressables system be trying to load all assets that do not have a label?

    Some sprites used by the scene are in the Resources folder. Could the addressables system be trying to load all assets in the Resources folder?

    Has someone encountered this before and found a solution?

    edit: detailed memory view when using packed mode in editor:
    memoryGoesBoum2.JPG
     
    Last edited: Feb 5, 2020
  2. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    I think I found out what is causing this: I have a group with UI sprites that is set to "pack separately" but the addressables system is somehow creating large sprite atlases out of them. In the the edit of the main post you see that in order to show a 10 KB sprite the game has loaded a 64 MB atlas.

    Is there a way to tell the addressables system not to pack the sprites into atlases?
     
  3. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
  4. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,816
    Hey there @Patrick_PS, we'd be happy to forward this over to the team for you. Which version of the Editor, and Package Manager are you using?
     
  5. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    Hi, I am using Unity 2018.4.12f1 (LTS) with Addressables 1.6.0.

    The sprites causing issues are in a group that is set to 'pack together by label' and assets in it (mostly sprites) have between 1 and 5 labels. My current theory is that bundles with a small amount of assets (less than 100kB of sprites) are somehow packed into enormous sprite atlases which then causes the texture memory usage to explode.
     
  6. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    @Patrick_PS And these sprites aren't assigned to atlases anywhere in your project? I wasn't aware there was anything that would pack sprites into atlases that weren't already part of an atlas. If you don't mind submitting a case through Unity with a repro project that'd be a huge help.
     
  7. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    I just found out that the artist I work with uses the Sprite Packer to group UI sprite in an atlas. I was packing these sprites into different bundles which could be the reason for the "memory leak".

    I will try to create a reproduction project later.
     
    davidla_unity likes this.