Introducing the Luau VM memory exploration tools

You should really update the UI for the developer console it still feels very outdated

4 Likes

Hello, There! General Micro-Optimization! On a serious note, thank you so much for this. Looks like I wonā€™t be sleeping tonight :sweat_smile:

This is great, Iā€™m new so I never used this till now.

One thing I would love to see fixed about this to improve itā€¦

  • add the ability to scroll where you pick ā€œLuauHeapā€

I had to close my output and drag the Dev Console all the way to the top of the screen to see it. It would be nice to be able to hover the mouse over the box and use the wheel to change the selection, or have a scroll bar.

I compared two versions of my game, one where players claim an area themselves, and one where the area is given automatically.

I could actually tell which one was better, it brought the client memory usage down by 300MB and there was 20,000 difference in the registry value. The one where area was given automatically was better.

this is so great! made more progress in 2 hours today using this tool than I did in 2 days last week

Iā€™m experiencing the same issue, clicking on snapshot for server does nothing, both in studio and in a live game

Iā€™m having this same issue in my game Empire Clash - the server just wont work. Creating a snapshot will cause the server to hang for a few seconds. However, no snapshot will generate after the hanging stops.

Please try again to see if you are still not getting a report.

Still not working for me

I managed to somewhat dial down the issue where I figured out where after x code is ran and all code after it, then the issue starts to occur

Hi
Seems to be working for servers with 2GB or so server memory.
Getting a ā€˜failed to send dataā€™ server crash if the server has 4-5GB of memory.

This tool has brought attention to me an issue of what I would call ā€œreference loopingā€?

For some reason this setup (or similar setups) hang out in nil FOREVER despite everything being :Destroy()ed


Iā€™m not super technically-informed with LuaU so Iā€™m not entirely sure on what these references mean and/or how I would fix something like this, but itā€™s something!

ReferenceLoop.rbxl (54.3 KB)

For added context, a few GUIs in my game have modules located in them for organization purposes, which are causing this issue and resulting in a memory leak for the game. Hoping to get it all sorted out soon!

Unfortunately, engine often cannot clear the result table of a module, even if if the ModuleScript is destroyed.
We checked and there were multiple games that relied on calling require on a destroyed ModuleScript.

Some developers asked us to not change this behavior: Release Notes for 596 - #15 by ceat_ceat

As a workaround, before destroying a ModuleScript, clear its result table manually:

table.clear(require(Setup.GoofyModule))
Setup:Destroy()

Would you ever consider adding this as a setting we could change in the future?

@Malt_WasHere , @ShoomamaAtlantis please check one more time, you should be getting your server heap captures.

works now, thanks. seems to operate as normal now

the one thing iā€™m observing is apparently explosions w/ explosion.Hit connections are never cleaned up after the explosion has finished? I was trying to trace an ever expanding memory footprint on some relatively straightforward scripts and believe I narrowed it to a simple explosion instantiation w/ explosion.Hit:Connect(ā€¦

Whatā€™s the proper way to fully clean up an explosion.Hit connection after it has run itā€™s course? Iā€™m surprised to learn this doesnā€™t appear to be done automatically.

Edit: I tried just slapping a
task.delay(3,function() explosion:Destroy() end)
in after the explosion was parented to the workspace and it stopped the runaway memory allocationā€¦ Wild as this isnā€™t mentioned anywhere in roblox docs nor do any of the guides on adding explosions mention the need to manually cleanup. My game uses a lot of em too :o

It is now possible to click on ā€˜ā€¦ā€™ and see all items inside. (Roblox version 614)

1 Like

Why does unique references show up on things that are already destroyed & set to nil from all tables:


I modified this module to make sure that the tables that contain the parts gets set to nil once it is destroyed, this also happens on other things like the player instance and the character instance even tho no table is holding a reference to them and i understand there are other things like connections and such but even connections should be automatically destroyed if the object has been destroyed, this is importantly concerning, is it possible that unique references doesnā€™t show all paths possible and only some or is there some explanation?

1 Like


How could I fix this? Iā€™m not sure how else I can improve on this? (Ignore the typechecking whoops)

1 Like

You can take the connection returned by Connect and use that object to disconnect in PlayerRemoving signal.

Alternatively, if this on the server, you can try auto-destroy of Player and Character using this property: New Player and Character Destroy Behavior
(if it doesnā€™t break something in the experience)

One other option is to not capture outer variables like ā€˜Playerā€™ argument from inside the connection, but this is not always possible.

1 Like

What about this? Sorry for the questions, Iā€™m a bit new to utilizing this tool.

image

Here is the character added event for the module: