I’m looking for possible ways to optimize the memory my game allocates with some help from the Memory Profiler package (1.1.3).
Under the “Unity Objects” tab (and after checking the Show Potential Duplicates Only option) I’ve noticed how there’s a certain “Strip Lut32” Texure2D that appears 50+ times and occupies about 14.5 MB. While this isn’t a massive amount, I would like to identify where it’s coming from, as it’s not an asset in my project.
For some reason, 50 of them are grouped under one parent, and the other 8 under another.
Clicking on Select in Editor shows the 1024x32 image in the Inspector, but doesn’t give me much to go off of. The Details section says it’s probably a dynamically created texture, so I thought it might get instantiated by one of my Post Process Profile (PPP) assets at runtime. All the PPPs that have a Color Grading override do use a lookup texture reference (and those are very similar to the image shown as the Strip Lut32 preview), but none are named “Strip Lut32”.
I had 2 PPPs that had the “Lookup Texture” check active, but no texture assigned. I thought they might be generating this default LUT dynamically, but unchecking these toggles didn’t reduce the duplicates.
Is this something I should worry over?
The reason for there being 2 groups is probably down to a small size difference?
And it’s not “probably” dynamically created, that’s pretty definitive. But the fact that the instance ID is negative tells us that it’s probably not created at run time, but instead at build time. This happens for example in the form of static meshes getting combined on building a scene. So it might be relevant to take snapshots in the Editor and see they can be traced in there.
Also, do any of these have references pointing to them? Given that they are marked as DontDestroyOnLoad (or rather have it’s Hide flags set to HideAndDontSave) it might not be referenced and maybe not even used but just leaked, all references to it lost instead of destroying it (especially if it was only ever referenced in the Editor and then included as part of a scene.)
Wait, this is an Editor snapshot right? Otherwise there should be no way to select it in the Editor. That’s only possible because the object with that instance ID still exists when looking at a snapshot from the current Editor session. It could be any kind of Editor tool that creates these.
Also, do you see those in built a Player too?
Yes, the grouping was down to a small size difference (256.5 KB vs 256.7 KB).
Yes! I mistakenly thought the memory profiler would look similar between the Editor and a Built player, but these textures don’t show up at all in the build snapshots. And neither do a lot of textuers I thought were problematic. As you said, it’s most likely an editor tool that’s creating them. Lesson learned, I guess. Better to profile memory on a build first.
Always 
That’s why the Summary page includes a warning if you open an Editor snapshot 