I try to print out the Lua memory used every 5 seconds by this line of code
local memUsage\_str = string.format( "MEMORY = %.3f KB", collectgarbage( "count" ) ) print( memUsage\_str)
and the output is following:
2013-12-25 20:02:17.680 Corona Simulator[55916:507] MEMORY = 1496.620 KB 2013-12-25 20:02:22.688 Corona Simulator[55916:507] MEMORY = 1597.093 KB 2013-12-25 20:02:27.696 Corona Simulator[55916:507] MEMORY = 1697.473 KB 2013-12-25 20:02:32.703 Corona Simulator[55916:507] MEMORY = 1797.853 KB 2013-12-25 20:02:37.712 Corona Simulator[55916:507] MEMORY = 1898.232 KB 2013-12-25 20:02:42.719 Corona Simulator[55916:507] MEMORY = 1998.612 KB 2013-12-25 20:02:47.727 Corona Simulator[55916:507] MEMORY = 2098.992 KB 2013-12-25 20:02:52.735 Corona Simulator[55916:507] MEMORY = 2199.372 KB 2013-12-25 20:02:57.742 Corona Simulator[55916:507] MEMORY = 2299.752 KB 2013-12-25 20:03:02.751 Corona Simulator[55916:507] MEMORY = 2400.132 KB 2013-12-25 20:03:07.758 Corona Simulator[55916:507] MEMORY = 2500.512 KB 2013-12-25 20:03:12.766 Corona Simulator[55916:507] MEMORY = 1994.880 KB 2013-12-25 20:03:17.775 Corona Simulator[55916:507] MEMORY = 1283.006 KB 2013-12-25 20:03:22.782 Corona Simulator[55916:507] MEMORY = 1383.386 KB 2013-12-25 20:03:27.790 Corona Simulator[55916:507] MEMORY = 1483.766 KB 2013-12-25 20:03:32.798 Corona Simulator[55916:507] MEMORY = 1584.146 KB 2013-12-25 20:03:37.806 Corona Simulator[55916:507] MEMORY = 1684.525 KB 2013-12-25 20:03:42.814 Corona Simulator[55916:507] MEMORY = 1784.905 KB 2013-12-25 20:03:47.822 Corona Simulator[55916:507] MEMORY = 1885.285 KB 2013-12-25 20:03:52.830 Corona Simulator[55916:507] MEMORY = 1985.665 KB 2013-12-25 20:03:57.837 Corona Simulator[55916:507] MEMORY = 2086.045 KB 2013-12-25 20:04:02.845 Corona Simulator[55916:507] MEMORY = 2262.923 KB 2013-12-25 20:04:07.853 Corona Simulator[55916:507] MEMORY = 2363.303 KB 2013-12-25 20:04:12.860 Corona Simulator[55916:507] MEMORY = 2463.683 KB 2013-12-25 20:04:17.868 Corona Simulator[55916:507] MEMORY = 2562.211 KB 2013-12-25 20:04:22.877 Corona Simulator[55916:507] MEMORY = 1245.923 KB 2013-12-25 20:04:27.884 Corona Simulator[55916:507] MEMORY = 1346.303 KB 2013-12-25 20:04:32.892 Corona Simulator[55916:507] MEMORY = 1446.683 KB 2013-12-25 20:04:37.900 Corona Simulator[55916:507] MEMORY = 1547.062 KB 2013-12-25 20:04:42.908 Corona Simulator[55916:507] MEMORY = 1647.442 KB 2013-12-25 20:04:47.915 Corona Simulator[55916:507] MEMORY = 1747.822 KB 2013-12-25 20:04:52.923 Corona Simulator[55916:507] MEMORY = 1848.202 KB 2013-12-25 20:04:57.931 Corona Simulator[55916:507] MEMORY = 1948.582 KB 2013-12-25 20:05:02.939 Corona Simulator[55916:507] MEMORY = 2048.962 KB 2013-12-25 20:05:07.947 Corona Simulator[55916:507] MEMORY = 2149.342 KB
(1) My app is total idle after launched. It stays in the first storyboard scene.
(2) I have checked I don’t have any timer.performWithDelay() running in the background
Although the LUA memory usage comes down after a while, why does it grow when the app is idle?
Is it normal?
Should I be wary about this?