Potential leak found server-side on baseplate


Open a new place file (baseplate) and start a server and 1 player.

Now add 4 more players

Now close those 4 players windows

I’ve kept this open for a few minutes now, maybe garbage collection needed some time to run or something, but no, it remains higher. Roughly 1mb extra per player that never gets cleaned up.


Fairly certain this is still PlayerGui never being cleaned up properly. Try calling PlayerGui:Destroy() on PlayerRemoving

What do you mean exactly? When I try to do Player.PlayerGui:Destroy() on player leave it just errors.

Perhaps that’s not the issue then. There was an issue previously that caused PlayerGui to leak a reference to the Player object… Here’s the thread about it

I had this same problem searching for a memory leak in my game but never posted a thread about it. The server never cleans up players who leave

I think this has been causing my game to crash recently - like in the past few days. There appears to be no issues in either client or server logs, and then randomly the whole server will crash after a little while of people joining and leaving.

We haven’t updated the game since mid-November so it’s definitely not started happening as a result of something we added. Been working fine until a day or two ago.

To provide some extra context - Roblox engineers diagnosed the crashes I’ve been experiences as a result of GetTouchingParts having some sort of memory issue. You might find if you look in the details that PlaceMemory > PhysicsCollision is the item that goes up and never comes down.

There’s a fix in the works, but it’s a crucial part of my game’s logic which is why it ends up leading to a full server crash after about 15 mins in my case. Try not to call this function until it’s fixed.

My guess as to why this happens in an empty baseplate is that the character scripts have a call to this function when they spawn maybe?

1 Like