Server memory "network/raknet" and "network/replicator" steadily increases until crashing

I’ve recently noticed the memory of my game’s servers going well over 6 GB and then crashing.

I thought at first it could be a memory leak in one of my scripts but Lua Heap doesn’t even go over 100 MB.

The real memory eaters are “network/replicator” and “network/raknet”, and I have no idea why these would be spiking. (they increase to be over a GB each)

Untracked memory also increases well over 2 GB which is quite annoying as I don’t know how to diagnose it. Anything helps.

What I know:

  • This is not a memory leak due to repeated connections as that would clearly show in LuaHeap.
1 Like

Did you happen to repeatedly connect useless runservice events? That might cause insane memory eating. Probably isnt but you know…

Yes. I’ve gone through every use of RunService in my game and can verify I am not repeatedly connecting any events off of it.

I’m almost certain this is not due to any repetition of new connections being instantiated.

In a simulation I made a script that recursively creates new connections and the source of the memory is clearly shown in LuaHeap:
Screen Shot 2021-03-14 at 7.12.52 PM

In my game, LuaHeap is not increasing at all, usually staying around only tens of MB (as it should). My main concern is “network/raknet” and “network/replicator” which clearly have something to do with the memory increase. I have found roblox servers tend to crash once they reach around 6 GB of memory.

This is still an ongoing issue and I have no idea what to do about it, anyone able to assist?

This is an issue for me as well, with my network/raknet hitting 1500MB in a server that has lasted 4.5 days. That contributes greatly to the server eventually crashing as it will crash once it hits ~6.5GB

I thought it was my fault so I tried changing up the RemoteEvents and it didn’t make a difference, raknet was steadily going up(like from 9.00 to 51.00 in less than an hour)

I ended up doing a simple test where me and my alt join an empty baseplate game and I spam the alt with data through a single RemoteEvent. The network/raknet ended up hitting 25MB over time and it never came back down. This seems like a memory leak

I’ve personally seen that this issue can occur even in Baseplate games and needs attention. We definitely need an explanation or a solution to this problem by Roblox.

image

Happened to my baseplate test(where I was purposefully trying to see if I could raise raknet to unreasonable levels without it dropping back down)