UIToolkit consuming huge ammounts of Ram (Possible Memory Leak)

I created a new project in 2021.3.4f1 LTS and used the UIToolkit to test it and learn how it works. After a while I noticed the PC was going slow so I opened the task manager and noticed that Unity was consuming almost 2gb of Ram, when usually consumes about about 500MB in an empty project.

I restarted Unity and noticed that it was working correctly, with a normal ammount of Ram consumed, until I opened the UI Builder again. After a while it began to eat resources to reach more than 2gb of ram again.

I tried to create another project and it was the same. I don’t really think that its a normal behaviour that the UI Builder consumes about 1,5GB of ram, even more with only a label and a button on it, with nothing else.

Replicating it is easy. Just doing a simple stress testing moving around one of the components makes the ram consumption build up infinitely. I uploaded a vid.

Tested it on my PC with the same action (wiggling a button around) and my memory started increasing constantly as well (and didn’t release the memory back after any length of time). I started at 1GB memory usage and got to 1.5GB after wiggling the button around for maybe 30 seconds. Only way to clear it seems to be to close Unity.

I wonder if it’s adding to the Undo history every tick whenever anything in the scene has changed, regardless of whether the action has ‘completed’ (like waiting for a mouse up)? This also seems to apply to actions like moving the opacity slider back and forward between 0 and 100.

Memory should be recollected by the garbage collector at some point. Can you file a bug using Help->Report a bug?

Thank you for reporting this issue!

Thanks I’ll do it right away.

It was a pleasure :slight_smile: