I’m experiencing severe memory leaks when using Lime. I ran through my code several times without finding the source of the problem when I figured it had to be something else causing it. And Lime was the only other code I had included in my program. So to check this, I added the monitorMem() function to the Viewer example from Lime’s member area.
Reference: http://blog.anscamobile.com/2011/08/corona-sdk-memory-leak-prevention-101/
This served as a good test-arena as it used director and therefore had several scenes I could switch between.
When adding the monitorMem code to screen_Main.lua from the Viewer example, I ended up with the following results (test done with Lime 3.4):
Before starting, the memory usage on the screen_Main.lua was:
MemUsage = 391.05
TexMem = 1.13
Then by navigating from the main screen to the selection screen, further to one of the game-scenes, back to the selection screen to finally return to the main screen, I got the following results:
From screen_Main to: (and back)
**1. Hello World:
MemUsage = 738.96 (Leak = 347.91)
TexMem = 2.17 (Leak = 1.04)
-
Animations:
MemUsage = 602.18 (Leak = 211.13)
TexMem = 13.71 (Leak = 12.58) -
Physics Slide:
MemUsage = 593.17 (Leak = 202.12)
TexMem = 1.65 (Leak = 0.52) -
Physics Tower:
MemUsage = 1004.30 (Leak = 613.25)
TexMem = 2.17 (Leak = 1.04) -
Multiple Tilesets:
MemUsage = 749.91 (Leak = 358.86)
TexMem = 3.22 (Leak = 2.09) -
Parallax Scrolling:
MemUsage = 1168.82 (Leak = 777.77)
TexMem = 4.27 (Leak = 3.14) -
Perspective Walls:
MemUsage = 800.23 (Leak = 409.18)
TexMem = 4.53 (Leak = 3.40)**
This is something similar to what I encountered in my own program.
So is there any way to prevent this, or any garbage-removal to take care of from my end, or is this something that needs to be looked into more closely? [import]uid: 129287 topic_id: 24951 reply_id: 324951[/import]