Need Help Understanding Roblox's "Untracked Memory"

Hello all,
I’ve been experimenting with the memory tab in the developer console in a testing experience within studio and outside of studio. I am concerned as my memory seems perfectly stable in studio, with very little usage except for that being allocated towards the core - thats why i decided to run a test in the experience outside of studio, resulting in a crazy ~3700 mb spike of “Untracked Memory” on the client side, seemingly fine on the server side with only a total of ~400 mb being used in total. I would like to know if this is memory actively being used, or maybe just memory allocated for later use? I dont believe that this is specific to my experience, but maybe my device? I am an amateur on this topic, and would like to ask! I couldnt find much on the forums on this topic - pardon me if I missed this same exact question that could have been previously asked.

its probably all react-lua bloat taking out huge spike of memory for “developer convenience”

Im sure its a portion, idk if it’d fall under “untracked memory” but even if it did i doubt its hitting even a gigabyte
Im sort of against all of the bloating it causes, but I dont think its the key issue that im facing with up to ≈4GB being wasted unnecessarily on the client.

1 Like

Im gonna take a gamble and assume that it’s the roblox client that is using all this memory? It would make sense that this is a result of all of that cached memory

You’ve totally got a severe memory leak. It’s usually caused by objects still being hard referenced in the code, which prevents them from being garbage collected even after being destroyed.

Your primary investigation points should be:

  • Check your connects, make sure you disconnect them properly
  • ^ Also watch out if you aren’t connecting something repeatedly in a cycle as unintended behavior
  • Check code pieces where you’re creating/destroying instances, make sure there aren’t tables that aren’t getting cleaned, which use instances as keys like table[instance] = “example”
  • Same thing above applies to tweens, if there are some hard references to tweens as keys in tables that persist - they might not gc, check on that as well
  • You can try using debug.setmemorycategory(“enteryourcategoryname”) docs link to track memory by categories that you can assign in scripts

Also take in mind that preloading all the assets in the game takes up on memory as well. If you’ve got hundreds of animations and all of them get loaded in, or even at least exist as animation instances - they’ll take a toll on the memory (but that’s more of a tip, cuz they have their own Animation memory category, instead of untracked memory)

2 Likes

Wouldnt this contributw towards luaheap? Again, im an amateur at this. I also dont think its a memory leak, i am reallly early into development and i ran some more tests with all of the major systems completely disabled. Im leaning towards it being the roblox player exe taking up all of this memory and it being read in the console as untracked memory. I also jumped in some other places and the issue persisted, so it truly is something involving my hardware or the client.

Thank you for informing me about this, additionally — i will put use of this.

Everything contributes towards Luauheap, correct. You can directly inspect the heap thru F9 console. There might be disparity in memory readings between task manager of windows for example and the memory that is shown by client. I cannot exclude that it could be a specific hardware-software combo issue.

In the f9 console memory tab, there is also something located as “untracked memory.” This is what i was originally referring to, if maybe we are on the wrong page? Or do you mean to say that scripts can contribute heavily to both of the categories? Sorry if im not understanding :slight_smile:

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