Script Rate and Activity % going up indefinetely

Recently my game started having this infinite rate and activity raise in one of the scripts, “Save Manager”

There are no repeat or while loops in this script, does anyone know why this could be happening? its damaging the server performance badly

Any help is appreciated

that’s called a memory leak, fix your code.

1 Like

yes that may be memory leak
make sure that you disconnect your connection when you donot need them anymore
also make sure that you donot have a table that will get more values forever
for example this is a memory leak

local tbl = {}

game.Players.PlayerAdded:Connect(function(plr) 
      tbl[plr] = AnyTHing
end)

the tbl variable will increase forever because the value wasnot reset when the player leave

1 Like

Thank you for explaining further and properly!

After a lot of debugging the issue was around:

  1. When the player was leaving their table[player] values were not being set to nil
  2. Couroutine.wrap() was causing issues, swapped it for Coroutine.create() and then using c.resume and c.close when needed
  1. There was a repeat loop who was being instanced every time a player joined, causing hundreds of repeat loops after the server was up for a while

Thank you!

1 Like