Memory leak help

I’ve had issues with memory leaks alot in my game and I have been trying to fix them. I fixed memory leaks with connections but all of a sudden a new memory leak appeared:


Player keeps increasing.
Can anyone explain why this is happening?
Everytime a player joins it increases by one, but if they leave it doesn’t decrease
Here it is on the client:

I disabled every script one by one and tested my game with 2 players but it still isnt decreasing when they leave.

1 Like

Since roblox is sort of black box, there are a lot of memory leaks that could be not the developers fault

1 Like

Yeah maybe… it just popped out of nowhere.

I tested it in my first place and told my friend to join me and leave,
it is a roblox issue!

By default, players and characters are NOT destroyed once they leave/die/etc. instead, their parent gets set to nil but they still “exist” which leads to a memory leak.
Try setting PlayerCharacterDestroyBehavior to Enabled and see if that fixes it.

New Player and Character Destroy Behavior - Updates / Announcements - Developer Forum | Roblox

1 Like

I tried and Player still increases.