Hi, all
I test this in HelloLua project.I write the hello.lua to follow:
function updateTime()
collectgarbage(“collect”)
print(“memory3:”, collectgarbage(“count”))
end
updateFunc_ = CCDirector:sharedDirector():getScheduler():scheduleScriptFunc(updateTime, 60, false)
collectgarbage(“collect”)
print(“memory1:”, collectgarbage(“count”))
—all of these will be auto released later
for i=1,100000 do
CCAnimation:create()
CCMenu:create()
CCLabelTTF:create()
CCScene:create()
CCLayer:create()
CCNode:create()
CCSprite:create()
end
collectgarbage(“collect”)
collectgarbage(“collect”)
collectgarbage(“collect”)
collectgarbage(“collect”)
print(“memory2:”, collectgarbage(“count”))
Run, and wait for a few minutes, I get thsi result:
[LUA-print] memory1: 776.4794921875
[LUA-print] memory2: 23305.096679688
[LUA-print] memory3: 23304.478515625
Is this a memory leak? And Could I avoid this? Thanks