I would like to know how much memory is used by the Lua table - without repeating the contents of the table and counting the usage. Is there a Lua 5.1 feature or a third-party library that could help with this.
You can control the Lua memory usage by calling collectgarbage("count") or gcinfo( ) in the appropriate places in the entire code (for example, before and after insert operations). There is no trivial way to get the size of a table.
collectgarbage("count")
gcinfo(
There is no function for this task. why do you want to do this? What are you trying to achieve?
Wouldn't something like this or this help?
2016 Update: see also: http://www.lua.org/wshop15/Musa2.pdf
Source: https://habr.com/ru/post/1304351/More articles:Blackberry - disable save function in BasicEditField? - user-interfacePHP - while loop - loopsZend Studio cannot detect Zend Server - phpFacebook-.NET Development - What Architecture? - asp.netHow to select inconsistent rows in MySQL? - mysqlMap UIView subregion to UIScrollView - iphoneJunit Exceptional Test - javajavascript number split - javascriptWhat is class level locking in java - javaJQuery click event, not working - javascriptAll Articles