What increases CPU Usage?

So my question is simple , What increases CPU Usage on general

So in my game we’re having an issue when players spam klling monsters , their CPU gets pretty high ( 100+ ms )

After investigating the issue , Memory isn’t the issue there’s no memory leak
Here’s before spam killing monsters

And this is After

( This is client only issue after rejoining it goes pretty good )

1 Like

I suspect events not being :Disconnected()

1 Like

what does the microprofiler say?

1 Like

are there any RunService or while true loops that get created whenever a new mob spawns?
You need to call Disconnect() on RunService Connections and call break on while loops that are made everytime a mob spawns (when the mob dies/gets destroyed), or you end up with like a hundred loops running at once, which can easily lag the server.

1 Like

Well i figured out the issue everyone , So there was a memory leak on the monsters effects, it’s weird bc memory didn’t have any increase but the CPU did ( the Circle part was getting added to " rotating objects " table but i forgot to remove it from the table after it getting destroyed )

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.