Local variable memory information

Currently in the memory profiler, if my main.lua contains a local variable that information is currently unavailable, even it it is taking up a significant amount of memory.

I have worked around this by assigning any variables of interest into _G though it would be nice to have that provided by default.

You're talking about the memory viewer, right?

Screen Shot 2022-03-09 at 11.30.21 AM

I looked into this in the past and never found a good way to do it but that might only have been because I didn't understand how lua closures work. (I still don't, really, but at least I know what they are now.) It seems like we'd be able to at least show locals for main.lua and its imported files. I'll dig into this again when I get a chance. Thanks for the suggestion!

Yeah, that is what I was referring to.

Lua does provide some level of introspection into local variables via the debug interface. I haven't used debug.getlocal personally but may be something that could help?