sbox-issues icon indicating copy to clipboard operation
sbox-issues copied to clipboard

[Memory leak] Ram usage of the editor going up and up .

Open QuackCola opened this issue 4 months ago • 4 comments

Branch

release & staging

Describe the bug

After awhile while coding a decently sized game project and or editor project the editor ram usage will climb and not drop until it fills up ram or you restart the editor. It would appear that even not hot-reloading a lot the editor memory usage will slowly go up over time.

To Reproduce

  1. do dev things as per usual. etc.. hot reloading alot and whatnot.
  2. Observe your ram usage going up slowly.

Expected behavior

For the ram usage to not be so insane.

Media/Files

My ram usage after a dev session hot-reloading my shadergraphplus project .

Image

Additional context

No response

QuackCola avatar Aug 04 '25 10:08 QuackCola

I have also been getting this - I have to restart my editor after a while as it ends up using all of my ram.

Fortune117 avatar Aug 04 '25 10:08 Fortune117

Okay so I'm not crazy, there is definitely a memory leak somewhere else.

K3rhos avatar Sep 03 '25 08:09 K3rhos

Hotload seem to not cleanup memory correctly

bub-bl avatar Sep 03 '25 11:09 bub-bl

I left the editor open overnight a couple of times and came back to it using all my ram. Some of my other programs were crashing because there was no memory left to use. The editor wasn't playing or doing anything, it was just sitting at the default scene that I had been testing a tiny component on.

[EDIT] I dumped the memory and opened it in dotMemory. It was a 10GB dump but less than 1GB was being used by managed memory. I guess it's some unmanaged memory that isn't being released somehow.

While reading the code I noticed that Sandbox.Services.ServerList.Dispose uses Free when I think it should use FreeWeak, since the constructor uses AllocWeak. That's not the cause of this leak though.

andy013 avatar Oct 29 '25 15:10 andy013