Hello everyone! For the past few months my project has been cursed: the editor slowly allocates all the RAM in the pc until it becomes unusable. Checking the Memory Profiler, I noticed that Universal Light Cookie Atlas_4096x4096_R16_UNorm_Tex2D has been created several times and has no objects in the “Referenced By” field.
I assume that the correct behaviour is that only one (or as many as are needed) textures get created. Restarting the editor purges the textures and only one is created. After several hours of use, there are tens of textures created (I count 70 this time)
I wonder if making an Editor script to call Resources.UnloadUnusedAssets() would fix leaky stuff like this…
I am blessed NOT to have leaky stuff right now but I’m curious if this would help you:
using UnityEngine;
using UnityEditor;
// put me in an Editor/ folder, obviously!
public static class CruftRemover
{
[MenuItem("Assets/Unload Unused Assets")]
static void UnloadUnusedAssets()
{
Resources.UnloadUnusedAssets();
}
}
Do you feel like escalating the battle? Hehe… I don’t technically recommend doing this at all, but I wonder if you could use this call:
To get all these items and call Destroy() on them yourself? It will probably blow up the editor so I’m not sure I’d trust using it until I restarted it… but it is fun to see what happens.
Still no solution to this problem? I’m having the same problem as the op, when you add a cookie to a point light (right now I don’t know if it happens with the rest of the lights), it adds a render texture like the ones in the op’s image until it consumes practically all your ram.
When dynamically created objects are created, inspecting the references of the few instance that are still referenced is often the most (only) useful analysis one can do besides checking their name. What is shown in those references?
That won’t do anything, these have been marked with the HideAndDontSave HideFlag.
Consider that the time of the EOY break is always a pretty slow time
I don’t think a bug has been reported yet? You could speed this along by doing so via the Editor Menu Help > Report A Bug.