lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi folks,

We are looking for large global variables that may be consuming lots of memory. I have this snippet I periodically run:

function dumpLargeGlobals()
   if not config.dumpLargeGlobals then return end
   for k,v in pairs(_G) do
       logger:debug({GLOBAL=k,value=v})
   end
end

This shows me *everything*. However, is there any way I can get the size of a table (in bytes)? I'm really looking for strings/tables that are excessively large.

TIA
Mike