Search Unity

SpriteAtlas and its Sprite repeat quote

Discussion in '2D' started by Youcai_zhou, Jun 24, 2021.

  1. Youcai_zhou

    Youcai_zhou

    Joined:
    Jan 27, 2021
    Posts:
    3
    Sprite quoto in the scene gameObject script,but leave this scene,use GC.Collect() and Resources.UnloadUnusedAssets(), Sprite and SpriteAtlas not dispose。look profiler,see SpriteAtlas and its Sprite repeat quote。
    upload_2021-6-24_17-0-53.png
     
  2. Youcai_zhou

    Youcai_zhou

    Joined:
    Jan 27, 2021
    Posts:
    3
  3. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,461
    Hello,
    Those circular references are a bit misleading and something we want to show as unimportant in the upcoming Memory Profiler package. I mean, they are relevant to see what's connected to what but beyond that, if one of the 2 objects is still referenced, the other won't be unloaded, but the circular references are not what is holding these objects in memory.

    Is there anything else that is keeping a reference to them? And is this a snapshot taken while the profiler was connected to a built Player, or is this an Editor snapshot? Because the Editor (including Playmode) can have odd memory behavior that won't be there in a built Player so, this might be a non-issue in a build.