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)
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:
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 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.