Search Unity

Atlas texture duplicated in memory

Discussion in 'UGUI & TextMesh Pro' started by tomzigza, Oct 4, 2018.

  1. tomzigza

    tomzigza

    Joined:
    Aug 4, 2017
    Posts:
    31
    Hi. Great product. Our development has gotten to the point where I am hunting down excess memory and I have noticed there are 2 copies of an atlas in memory(4 megs each). Here is our setup

    Per posts on your forum, when using atlas bundles its ok to move all the actual font atlases outside of the resources folder in the TMP default configuration and put them in a bundle. We have chosen to put them in a bundle that we stick in the streaming assets folder so its available at launch.

    Our game runs entirely in a single scene FYI. We just remove and add content as needed.

    On startup sitting at the title screen I can take a memory snapshot on device and see our font listed once with 620 references.

    next i hit start which removes the visuals and puts a new component on the scene(same scene, no level change).

    Now I see the same 620 references on the atlas texture, but a new atlas texture has appeared with 5 references roughly corresponding to the labels on the 2nd screen.

    Why would a label make a new font atlas instead of using the one thats in the system and being used by other labels already? If i had to guess I would point my finger at asset bundles because they are complex ;) Everything in the first scene is in a bundle from streaming assets but the 2nd scene has stuff from other asset bundles downloaded during the startup scene(the first scene).

    The font was there from moment 1 as its also in streaming assets.

    Thanks in advance for any info you can provide on this!