I'd like to find out how much memory a lua table is using - without iterating through the table contents and counting up the usage. Is there a lua 5.1 function or 3rd party library that could help with this.
Thanks!
I'd like to find out how much memory a lua table is using - without iterating through the table contents and counting up the usage. Is there a lua 5.1 function or 3rd party library that could help with this.
Thanks!
There is no function for this task. Why do you want to do this? What are you trying to achieve?
You can monitor the memory usage of LUA by calling collectgarbage("count")
or gcinfo(
) in the appropriate locations throughout the code (e.g. before and after insert operations). There's no trivial way to get the size of a table.