20GB+ memory usage in Editor by Texture2D

Hi,

I’m struggling with an editor problem.
In one my scene, my computer reach 95% of my RAM usage by Unity.

I downloaded the memory profiler and I can see 20+Gb of memory used by Texture 2D with more than 2000 assets loaded.

Same data in Unity profiler (during play mode)

Any idea of what’s going on ? And maybe a clue to solve this ?

I really do wasting some precious time here with those ram issues (like everybody I know but still)

FYI :

Caching preprocessor checkbox is disable (of course enable it doens’t change anything)
My coworker doens’t seems to have the same probleme with the same project and same scene.
I do have the problem in play mod and editor mod BUT I don’t have any issue with the standalone PC build.
I try enable and disable texture streaming


Here’s a funny screenshot of my task manager

Oups sorry :

Unity 2020.3.23f1 HDRP 10.7.0
Windows 10

Please don’t let me on the page 2 I really need help on this one :wink:

Anyone from Unity maybe ? The amazing @MartinTilo maybe ?

Thanks :s

I can’t really tell you much from that high level view either. In the first screenshot, your textures average out to 9.4MB each (20MB each in the second screenshot) and judging from the split of 12 GB across Other and Graphics and Graphics Driver, I’d wager they are all taking up double memory due to Read Write enabled or otherwise somehow retaining their CPU copy in memory.

Have you checked what’s referencing these textures to see why they are kept in Memory? (Clicking on the blue number I the References Count column of the table?) Did you check their names to see if they should be in memory?

Not much else I can tell from this. If it’s Editor only and your colleague doesn’t have it, maybe you have some editor tool or window open that your colleague isn’t using?

I try to investigate more and check references but there’s no Read/Write enabled and I really don’t know why Unity would kept thoses references in memory.

Even in a empty scene I have 2Go of textures2D load in memory.
I try to update all my tools, remove unused one.

A bit lost to be honest.

In this scene, we don’t use the RoadV1_Displacement, but it’s still loaded in memory in Play mode (even in editor mod)

You can see the params of this texture, it’s look normal doesn’t it ?

Have you tried changing the Texture Format from Automatic to something else? the Preview shows that it is not yet compressed and uncompressed textures are going to be rather memory heavy.

Is this the only texture of this name or do you have one named just the same in every one of those V2/01, 02, 03 … folders?

Did you have the texture selected when you took the snapshot of the Editor, or had it selected shortly before, so that the Editor would have loaded it into Memory for use in the Inspector? If no recent Resources.UnloadUnusedAssets (happens on scene load, should happen on enter play mode) would have unloaded it yet after it was loaded, that might also be why it still shows up in memory without any references.

Does it also show up without any references in the Memory Profiler Package? That tool tracks Managed Objects and their references too so you might be missing part of the picture in the Memory Profiler Module UI.