Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
3

What is collectgarbage() and untracked data? Guidance please?

Asked by
Myune 24
4 years ago

I have been having what I assume a memory issue, roblox would crash but I thought nothing of it until I recently looked at my memory usage. Just a simple place alone with 1 or 2 scripts skyrocket my memory usage, most I seen was a few gigs. So, I tried to google what this was, and everything just said to close functions you will use or close (disconnect() or delete) functions you will never use again, well, just a few minutes ago, opened a BRAND NEW BASEPLATE, and it says 713 mb of memory is being used, a whopping 509 and climbing is UNTRACKED, but this is a new baseplate! What could be the issue?

Also, what is collectgarbage()? I learned how to count my garbage with it, is it bad to use? why does an empty NEW game have GARBAGE(it counted 66.265625)>what’s that number even mean? My place with just meshes, and parts (no scripts) has the exact same amount! I have no idea how to find “untracked” memory.

What does everyone do when they have an ungodly amount of untracked data that comes from what seems like nowhere?

I am very sorry if this is the wrong place to ask this, please guide me to where I should ask this, I hope this post helps anyone else with this issue. Thanks to any kind soul willing to guide me.

0
I believe a good amount of untracked data issue is on Roblox's end, from what I've seen from what others have said. If you see the same issue in an empty baseplate without any scripts, there isn't much you can do. alphawolvess 1784 — 4y
0
I do know that you should clear tables that arent in use, and delete instances you dont need anymore Fad99 286 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

collectgarbage gives you options to manage the garbage collector. However, in Roblox, you can only count how much memory is being used and unfortunately not start a manual garbage collection which frees (lets other processes use the memory) memory no longer in use, which is called garbage (or at least I think) is because its just sitting around and wasting memory. What you get from using the collect option is the total amount of memory used in Kbytes (what the Lua docs say, it could be a kilobyte or a kibibyte) and 66 kb used isn't a lot. I think that, since how memory is categorized in Roblox isn't related to you programming in Lua, you should ask in our Discord server instead of the site.

Ad

Answer this question