- Home /
Why a texture always consume twice RAM when running?
I make a simple scene to clarify this problem. 1) import a 2048x2048 RGB 24bit texture, no mipmap.
2) create a new scene, then create a plane assigning a diffuse mat with this texture.
3) Run, the memory profiler tell me this texture consume 24mb rather than 12mb RAM.
It's insane since I can't use a texture simpler than this example, NO mipmap, NO scripting, NO GUI, just drag and run. However, the memory size was exploded than expected.
Is it a bug? My unity version is 4.6.5.
Answer by Eudaimonium · Jul 18, 2015 at 06:16 PM
Well, it does say "RefCount (number of references)" : 2, so it makes sense.
Where are you using those textures? Sounds like two different materials are using it.
If you are not using it anywhere at all, then this is a very good question I'd like an answer to.
Your answer hinted me. I've figured it out. The 2 ref count came from two places: 1) the running game. 2) unity editor.
So If I built a standalone then ran and profiled the memory, nothing went wrong.
conclusion: Don't profile the memory in editor. Profile the standalone app ins$$anonymous$$d.