I am currently in the process of creating a game that I hope one day will be
released to the app store. I have come across a problem where every time I
press the new game button, memory is leaked.
This is how I determine how much memory my program is using:
[blockcode]
local function monitorMem(e)
collectgarbage()
print( "MemUsage: " … collectgarbage(“count”) )
local textMem = system.getInfo( “textureMemoryUsed” ) / 1000000
print( "TexMem: " … textMem )
end
local memoryTimer = timer.performWithDelay(1, monitorMem, 0)
[/blockcode]
When I first run my program this is the result:
MemUsage: 315.283203125
TexMem: 19.188736
After I press newGame the result is always very close to:
MemUsage: 368.228515625
TexMem: 20.826112
I have been struggling to fix this problem for over a week and was wondering if anyone has any
suggestions or has come across a problem like this of their own.
I will post code if necessary, but I want to make sure it isn’t some bug or that someone knows the solution
based on their own experiences.
Thanks in advance,
David
[import]uid: 152065 topic_id: 32153 reply_id: 332153[/import]