I want people to have a smooth/lag free experience in my Tower of hell based game
The client memory in my game keeps increasing with time and its causing players to lag
After being in the server for an hour, the client memory keeps building up and reaches to about 1000MB. People have reported to have lower fps/they were lagging.
One of the people sent me a screenshot of they client memory after staying in the server for more than an hour, he reached 1000MB of client memory
So i would like some advice on how to prevent this from happening
I have taken measures to prevent this such as using :Disconnect() on connections like kill bricks touch when the kill bricks are destroyed, as well as refrained from using while true do and using RunService.RenderStepped for loops instead.
But something still seems to not working quite right and the client memory still rises and causes lag for the players
I’ve looked into my local scripts many times for any possible cause of the memory increase but i can’t seem to find anything that maybe be causing it.
There are Conveyors, Fading Parts, Kill Parts, Moving Parts, Slippery Parts, Local Parts and Spinning Parts in the game at the moment which are made local/work from local scripts
and Buttons and Height bar, etc
In the developer console, go to Memory. Make sure “Client” is selected. Scroll down to “PlaceScriptMemory”. It should show the cause of the lag(as it gives the names of the scripts), which should make it easier to find the solution. You could also try checking PlaceMemory>Script, but this just gives the overall memory usage of scripts if I’m correct.
Thanks for the info and sorry for the late reply, i’m not using the maid module to connect/disconnect functions but this seems useful, should i use this to connect and disconnects functions?
Currently it only says its using about 5 Mb of the memory, don’t think that’s a lot and if it ever rises up i won’t be able to tell exactly which script is is causing the lag because it gives the overall memory usage of scripts