oh By the way using this code for memory leak check:
local monitorMem = function()
collectgarbage("collect")
print( "\nMemUsage: " .. collectgarbage("count") )
local textMem = system.getInfo( "textureMemoryUsed" ) / 1000000
print( "TexMem: " .. textMem )
end
local memTimer = timer.performWithDelay(3000, monitorMem, -1)
And here the terminal view below: You will notice that the memUsage will go and up down as “rocks” are created and then destroyed by the gun. BUT when an explosion (PC) happens, the memUsage go up (which is normal since images are displayed on the screen) but when the explosion is done, the memUsage stays high?
If I knew how to detect the end of an PC effect (explosion) then maybe I could just cleanup those particles image. I would assumed that when an explosion effect is done during the game, that the particle would be removed in real time when their lifetime is over. Am I right on that?
I definitively need to resolve this issue of memory leaks before releasing since after a while the game slows very badly!
Thanks again for any help.
Mo.
----------------------- TERMINAL VIEW(better listing) -------------
new rock…
MemUsage: 371.037109375
TexMem: 2.754048
MemUsage: 371.802734375
TexMem: 2.754048
MemUsage: 370.216796875
TexMem: 2.754048
MemUsage: 371.447265625
TexMem: 2.754048
MemUsage: 370.599609375
TexMem: 2.754048
–> Particles.StartEmitter(): EMITTER ‘gunEmitter’ STARTED.
–> Particles.ClearParticles()
- 0 bytes rock.png
rock image deleted
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/flare.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
MemUsage: 387.451171875
TexMem: 2.758144
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
- 0 bytes Particle_Images/fireball_medium.png
- 0 bytes Particle_Images/fireball_bright.png
MemUsage: 397.857421875
TexMem: 2.758144
- 0 bytes rock.png
new rock…
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
- 0 bytes Particle_Images/smoke1_light_dark.png
–> Particles.StopEmitter(): EMITTER ‘gunEmitter’ STOPPED.
MemUsage: 407.712890625
TexMem: 2.758144
MemUsage: 405.826171875
TexMem: 2.758144
MemUsage: 407.056640625
TexMem: 2.758144
MemUsage: 405.990234375
TexMem: 2.758144
MemUsage: 406.017578125
TexMem: 2.758144
–> Particles.Freeze() - PARTICLE SYSTEM FROZEN.
[import]uid: 49236 topic_id: 14147 reply_id: 52045[/import]