Hi all,
I am working on a project, since I found my app will slow down after lunching for about 5 mins, I guess there is one or more memory leak in my code, I kept comment out my code to find where the leak is and end up having only
Runtime:addEventListener("enterFrame",function ( event ) print("Engine Memory Usage: "..collectgarbage("count")) end)
in my main.lua
After about 2 mins inspection, I made sure that corona clear the memory every a few seconds, which matches the apple’s garbage collection algorithm, however the memory used after clearance n+1 will always be a few more than memory used after clearance n, which means the app will eventually leak all the memory even it is not doing a single thing while doing things will makes it faster
For example, with only enter frame call, memory usage is like
200 -> 400 -> 210 -> 440 -> 230 -> … -> leak all the memory
if I do something, then it would be like:
1500 -> 2500 ->1700 -> 2800 -> 2000 -> … -> leak all the memory quicker
Is that a corona bug or am I doing anything incorrect? BTW, I have only run it in corona simulator, but I guess that does not matter…