[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Getting table size information
- From: mchalkley@...
- Date: Thu, 5 Feb 2015 18:13:25 -0500
Thursday, February 5, 2015, 6:01:04 PM, you wrote:
> Am 05.02.2015 um 21:36 schröbte firstname.lastname@example.org:
>> I'm trying to debug some memory usage issues in a Lua script that I'm
>> working on.
>> What's the best way to get the total amount of memory a table is using?
> There is a module lua-getsize that adds a `debug.getsize` function which
> does what you want. Original is here, a modified version that fixes
> some issues and adds compatibility with Lua 5.2 and 5.3 is here.
> lua-getsize uses PUC-Rio Lua internals, so it doesn't work with LuaJIT.
> You can combine lua-getsize with the microscope module to get
> GraphViz images like this (sizes in bytes are in square brackets).
> : http://code.matthewwild.co.uk/lua-getsize/
> : https://github.com/siffiejoe/lua-getsize/
> : https://github.com/siffiejoe/lua-microscope/
> : http://siffiejoe.github.io/lua-microscope/example1.gif
Awesome - thanks very much for the assistance!