What is causing this?

Whenever I play-test my my game, every so often my game gets extremely laggy, and the “Untracked memory” of the game skyrockets. What’s causing this? Why does this happen? Can someone tell me how to fix this?

2 Likes

Are there connections you haven’t disconnected? Are there loops that are ongoing? Did you put waits() in your scripts? Not having these things can cause memory loss, and lag. Check what is happening in the game when the memory skyrockets, for example if the player levels up and the memory skyrockets, there could be a potential problem in the scripts where the player levels up.

2 Likes

Pretty sure untracked memory is irrelevant and the scripts are being overloaded in activity. Try check for potential infinite loops that may be unnecessary.

Alternatively, disable chunks of scripts and narrow down which scripts are the perpetrators.

2 Likes

One thing that I forgot to mention, is when this lag / untracked memory goes up, the rate of all the localscripts go down to either 0.0/s or 1.0/s.

1 Like

I don’t see the problem from that for now. Maybe because part count also matters?

3 Likes

Have you checked for any infected models? Usually those can cause quite a lot of lag, especially for less powerful devices.

From what I can remember, they are usually hidden in parts, as either a single Fire object, or a mesh with the Fire object inside.

This was pretty common back around 2010-2016 but usually is done through require scripts nowadays.

1 Like

I did a test, and apparently removing parts, and separating unions, and anchoring parts helped fix the issue.