I disconnect all connections and even that is not helping eliminate lag buildup in my game

Overtime in my game Downhill Rush - Roblox
As the server is running


This is the server memory at the start


Untracked memory is taking bigger and bigger.

I wonder how the other games do it.

I have disconnected all connections at the end of each round and set each variable to nil that wasn-t needed.

This is the script performance for the current game. I have no clue what it means

1 Like

There’s a script inside your game, named script which is causing the issue. The explorer “Filter workspace” tool may help you locate it(search for one named exactly script not Script):
Capture
Although if the script is some kind of free model script trying to hide itself, it may rename itself to “script” after the game runs, so I also advice you to use the tool while the simulation is running(and you’re viewing it as the server).

That’s a script I made though it’s the script that runs the game.

Are you running the entire game in a single script?

1 Like

No. The script that runs the round is simply…

while players > 0
If there’s a player near the end
generate a new stage
end

– cleanup and rewardthe players etc

Well according to the console the round script is causing the memory leak. Perhaps try searching for loops inside events which aren’t breaking, temporary events which aren’t disconnecting, values which aren’t cleaned after script execution(example debounces) and try addressing everything which can lead to a memory leak.

I did a check. I think it is much cleaner now. Thank you!!

1 Like