collectgarbage
Definition
-- @/=[C]:-1
function collectgarbage(...)
Callers
@/lua/common/luaProfiler.lua
if section ~= nil then
local garbage = self.garbagePrev and (collectgarbage("count")*1024 - self.garbagePrev) or nil
local time = self.timer:stopAndReset()
self.timer:stopAndReset()
self.garbagePrev = collectgarbage("count") * 1024
end
self.timer:stopAndReset()
self.garbagePrev = collectgarbage("count") * 1024
end
@/lua/ge/extensions/flowgraph/graph.lua
-- before work()
table.insert(fun, '\n garbageTmp = collectgarbage("count") * 1024 ')
end
-- after
table.insert(fun, '\n garbageTmp = max(0,collectgarbage("count") * 1024 - garbageTmp)')
if gcprobe_grouping == 'individual' then
@/lua/common/utils.lua
function gcprobe(printZero, omitPrint)
local newgccount = collectgarbage("count") * 1024
if __prevgccount__ then
local dif = newgccount - __prevgccount__
collectgarbage('restart')
if (dif > 0 or printZero) and not omitPrint then print(dif) end
else
collectgarbage('stop')
rawset(_G, '__prevgccount__', newgccount)
@/lua/common/luaBinding.lua
tmp = nil -- free everything
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
collectgarbage("collect")
@/lua/console/json-performance.lua
local function test()
collectgarbage()
local jdecode = json.decode
local function testLpackEncode()
collectgarbage()
hp:stopAndReset()
local function testLpackDecode()
collectgarbage()
hp:stopAndReset()
local function testLpackEncodeBin()
collectgarbage()
hp:stopAndReset()
local function strbufEncode()
collectgarbage()
hp:stopAndReset()
local function strbufDecode()
collectgarbage()
hp:stopAndReset()
@/lua/common/json.lua
local function jsonError(msg, i)
if gcrunning then collectgarbage("restart") end
local curlen = 0
if si == nil then return nil end
gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
s = si
s = nil
if gcrunning then collectgarbage("restart") end
return result
@/lua/common/lpack.lua
local res
local gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
local gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
s = is
s = nil
if gcrunning then collectgarbage("restart") end
return res
@/lua/common/jsonDebug.lua
local function jsonError(msg, i)
if gcrunning then collectgarbage("restart") end
local curlen = 0
local function jsonWarning(msg, i)
if gcrunning then collectgarbage("restart") end
local curlen = 0
if si == nil then return nil, warnings end
gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
gcrunning = collectgarbage("isrunning")
collectgarbage("stop")
s = si
s = nil
if gcrunning then collectgarbage("restart") end
return result, warnings
@/lua/console/bananabench.lua
local bupdate = BeamEngine.update
collectgarbage("stop")
jit.off()
jit.on()
collectgarbage("restart")
-- do a warmup round
collectgarbage("collect")
myBenchStep(testVehicle, vehLPackData, n, 5)