Untracked Memory Question

I have a quick question about untracked memory.
Is all of the untracked memory from scripts that a player creates? The game that I have made has between 40 and 80mb of untracked memory at all times. Is this something that I have caused by doing something in my scripts? If so, what exactly causes this to happen? I have all of my variables accounted for, and I don’t know what would be causing it.

1 Like

The untracked memories most likely came from events that aren’t being in used but was not disconnected or garbage collected.

2 Likes

But why is it untracked, if it is still in use, and assigned a variable?

1 Like

I don’t think so. If you are very sure that the variable is in used still, then it wouldn’t end up in untracked memory.

1 Like

Hmm ok. I guess that I will have to check out all of my scripts again. Another thing though, the untracked memory that is in use in my game varies a lot. Every time that it updates it changes. One of the biggest changes that I have seen was a 40mb to a 70mb jump in untracked. What causes this?

1 Like

Did you create scripts that connects a lot of unecessary events? If so, that might be an issue. I’m not an expert in solving these but this is the surface of untracked memory.

I do have a couple of mouseclick events and playeradded events, and all of my remote events are handled by Sleitnick’s Knit. I’ll just look into how they are being used though to figure out the reason for the big jumps.

1 Like

Then most likely those are causing untracked memory, which should be fine, but just make sure you only connect events necessary.

What would be the best way to connect events for up to 20 ui buttons? I currently just loop through them all and add a connection for each one to a table. I don’t think that there is really any other way for those. Are bindable events more memory efficient?

As for the player added events, would it be better to just have one module that calls all of the other modules’ player added events once a player joins, or have each one call its own. I would assume the first one, but you never know.

Good question, im still not an expert of making this as low as possible in terms on untracked memory. But, I can tell you that you can connect the UI buttons to events. It’s better if you can seek advice from a more advanced scripter.

Ok. thanks for your help still. :+1:

I’m not an expert on how Roblox’s memory tracking works, but your varying Untracked memory could possibly be related to garbage collection or internal events.

Edit: added on to my reply.

Ok, well I guess that if I had looked harder I would have found this :sweat_smile::
Garbage Collection and Memory Leaks in Roblox - What you should know - Resources / Community Tutorials - DevForum | Roblox
Here it is for any future people that see this. It was helpful for some of the problems and explaining some things about garbage collection.