You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

15 lines
462 B

-- returns the PID and memory peak of lua process itself
local process_information = function ()
local result = { memory_peak = 0, PID = nil}
for lines in io.lines ('/proc/self/status') do
if (lines:find ("Pid:") == 1) then
result["PID"] = lines:match ("%d+")
end
if (lines:find ("VmPeak:") == 1) then
result["memory_peak"] = lines:match ("%d+")
end
end
return result
end
return { process_information = process_information }