Memory profiler shows a texture is referenced by a material, but it's not

In a snapshot of the Memory Profiler, it says this texture “blush” is referenced by 2 materials. enter image description here

I clicked the “Select in Editor” button, and the inspector highlighted the Material. And as far as I can tell, it does not reference the blush texture, but using the default particle texture under “Maps”.

enter image description here

I tried this procedure with another texture “skull5” in the snapshot, and it seems working fine.

enter image description here enter image description here

The question is how does the material reference the “blush” texture? How can I delete the reference? I don’t want that texture to be included in the build and in the memory when the game started. Thanks!

1 Like

Hi,
Is there a chance that, similarly to your other issue, you are using the Blush texture or a different one from it’s Atlas in a ParticleSystem which might then set the Blush texture as the texture for the Material?

Or that you are modifying the material from a script to have a different texture?

@MartinTilo Thanks for your help. Do you mean for example two particle prefabs A and B are using a same material, and prefab A using texture A and prefab B changed the texture to B in its prefab, so material has a reference to texture A. Then in the profiler when I clicked on “Select in Editor”, it leads me to material with texture A. Even though I didn’t use prefab A in my project, texture A is still included into the build and loaded into memory?

If this situation is what you mean, I think this could be the reason. I might have imported some packages with prefabs, and made changes to use the prefabs, however I didn’t create a brand new prefab with my changes, and causing said situation.

Giving a second thought, it seems the described situation should not cause the problem. Because if not as a brand new prefab, prefab B must exist either in a scene or as a prefab variation which has a reference to prefab A. And in the prefab B there’s no reference directly to texture A, but only a reference to material A with the changing of referenced texture to texture B. And during build phase, the compiler should know about this and exclude texture A out of the build.