Search Unity

SpriteAtlas bundle generation crash in editor (out of memory)

Discussion in 'Asset Bundles' started by LaMarche, Sep 10, 2021.

  1. LaMarche

    LaMarche

    Joined:
    May 7, 2018
    Posts:
    4
    Hi there,

    We have a project with loads of sprite atlases, each is built into its own bundle using Addressables.
    At some point during the build (the WriteSerializedFiles task) the editor crashes because the system is out of memory.
    If I hack into the code and insert a good old
    Resources.UnloadUnusedAsset()
    between each bundle, the memory remains steady until it reaches the SpriteAtlas bundles. Then the memory keeps going up, and it seems due to the (CachedSpriteAtlasRuntimeData) super object, indirectly referenced by the SpriteAtlasDatabase (which isn't touched by
    Resources.UnloadUnusedAsset()
    ).
    Each atlas is kept in memory until the editor crashes.

    Is there any API that could allow us to free that unused atlas memory during the build process?
    We would like to be able to build without upgrading our hardware.

    I already posted this message in the addressables sub-category but it remained unanswered.

    Thanks
     
  2. LaMarche

    LaMarche

    Joined:
    May 7, 2018
    Posts:
    4
    I'll allow myself to bump this thread.
    This makes our project un-buildable, with no guarantee that if we upgrade our hardware the issue won't come back as the project keeps growing.
    Thanks
     
unityunity