I am currently using this code to keep a tab on my memory usage, but was wondering if this is the best way (since I’ve stumbled upon some other ways, but not sure)… here’s where I got my memory mangement code: http:</http:>
local lastCheck = {sysMem = 0, textMem = 0}
Runtime:addEventListener(‘enterFrame’, function()
– watch for leaks
collectgarbage()
local sysMem = collectgarbage(“count”) * 0.001
local textMem = system.getInfo( “textureMemoryUsed” )*0.000001
if lastCheck.sysMem ~= sysMem or lastCheck.textMem ~= textMem then
lastCheck.sysMem = sysMem
lastCheck.textMem = textMem
print ("mem: " … math.floor(sysMem*1000)*0.001 … "MB \t " … math.floor(textMem*1000)*0.001 … “MB”)
end
end)
local fps = require(“fps”)
local performance = fps.PerformanceOutput.new();
performance.group.x, performance.group.y = _W/2, _H/2 +400;
performance.alpha = 1; – So it doesn’t get in the way of the rest of the scene