- Home /
Both atlas and individual sprite in memory?
Hey unity community!
We use Unity's built-in atlas packing, and it works really well for our world decorations.
But for one set of sprites that we use for a part of our game (mostly as a UI) Unity seems to load both the atlas, and the individual sprites, into the memory.
When I click on the atlas in the Profiler under memory details and select the correct part, it is referenced to the correct GameObject in the scene hirarchy. When I click on the individual sprite for the same image, it is also referenced by the exact same GameObject.
This does not happen for any other atlas packed sprites that we load as prefabs during runtime, but in this case they are referenced directly in the scene hierarchy and produces these weird duplicate memory entry results.
Project settings are set to always enable sprite packing, and none of the sprites are in the Resources folder as we are fully aware of this issue regarding sprite packing and that folder.
Here is the Atlas in memory, pointing to HomeSlot:
And here is the individual Sprite in memory, pointing to HomeSlot:
Any help greatly appreciated!!!!
Thank you.
We are moving our UI elements to be a prefab instantiated as a prefab right now, this is the only thing that works for the rest of our game using the built-in atlas sprite packing so here's hoping it works.
However I still don't see why what we're doing right now doesn't work properly.
This seems to be the case when profiling the editor, but in my experience when profiling the device only the atlas is loaded into memory.
Hopefully this is always the case.
Stumbled across this old post when trying to figure out a similar problem. $$anonymous$$any of our sprites are showing up in the profiler and having a large memory impact, even though they are definitely packed in the sprite atlas.
Anyone know what's going on?
I made the same observation. Sprites are shown as atlas and individual in unity memory profile connected to an iOS device.
I really hope Unity gives us some information about this.
Same here, this thread is from 2015 and in 2017 using Unity 2017.3.0f3, i'm having this problem, can't figure out the reason.
Answer by hugojacob · Jun 10, 2016 at 12:10 PM
We had the exactly same problem. What we did to solve this was deleting the library folder and restarting Unity.
Answer by agandullogenera · Jun 27, 2017 at 01:54 PM
Check if the sprites in the atlas are being used also as a texture in a shader that is not a sprite shader. If a sprite in an atlas is use in a shader as a Texture this will be included in the build and in memory as a different texture apart from the one included in the atlas.
Resume: be sure that what you put in a Sprite atlas you use it as a Sprite otherwise it will be included twice.