Minimal example code
resty example.lua
local function get_memory_usage()
local b = collectgarbage("count") * 1024
return b
end
local my_table = {}
for i = 1, 10000000 do
my_table[i] = string.rep("A" , 256) .. i
end
my_table = nil
print("start gc:", "mem:",get_memory_usage())
collectgarbage("collect")
print("end gc:", "mem:",get_memory_usage())
print("sleep 10m")
print("done")
ngx.sleep(60*10*6)