Max System Memory?

I wonder what values for maximal system memory usage should be okay?

In my current game i have a lot of enemies and moving sprites with bullets on screen and a lot of particle systems.

Even in a screen with static objects the particle system is the only animated and the system memory is counting up and up.

After about 15 minutes of only watching the particle system and some of the static elements on screen I have a system memory usage of 200000 KB and a texture memory usage of 75 MB.

Is this a “normal” value?

~200MB of system memory + 75MB of texture?  No, that (~275MB) seems a bit high, especially for Android devices, but even older iOS devices will have a problem eventually. 

Have you graphed this over time?  Is it increasing over time or is that a static value.  It sounds like you’re saying this value increases without bound.  If so, you’ve got a leak.

Thx for the info. The number is growing and growing. Sometimes it is removed a bit but never as much as it started with, so over the long run it only is growing up. I’ looking into this.

I’m not creating new objects btw. … so I wonder if maybe my transitions or timers can cause this kind of behavior? I have a lot of transitions which are added to a transitionStash={}. All transitions contain anonymous functions. And the stash is only “cleared” with a scene change… so as long as the level is played the stash grows and grows.

Can this be a reason for the huge memory “leak”?

Any Lua object (typically tables) you create (or which is created by Corona) that you keep track of (like your stash) will take up memory until Lua can garbage collect it. 

So, if you’re holding on to a bunch of Lua table references, eventually you’ll start to soak up some real memory.

Now, with regards to closures… I’m less familiar with how their memory is managed, but I imagine the concept is similar.  Till Lua can garbage collect them, they will hang around too.

I suggest you avoid making multiple closures and dynamically generated functions.

Also, there should be no need to hold onto a transition return value beyond the end of the transition.

~200MB of system memory + 75MB of texture?  No, that (~275MB) seems a bit high, especially for Android devices, but even older iOS devices will have a problem eventually. 

Have you graphed this over time?  Is it increasing over time or is that a static value.  It sounds like you’re saying this value increases without bound.  If so, you’ve got a leak.

Thx for the info. The number is growing and growing. Sometimes it is removed a bit but never as much as it started with, so over the long run it only is growing up. I’ looking into this.

I’m not creating new objects btw. … so I wonder if maybe my transitions or timers can cause this kind of behavior? I have a lot of transitions which are added to a transitionStash={}. All transitions contain anonymous functions. And the stash is only “cleared” with a scene change… so as long as the level is played the stash grows and grows.

Can this be a reason for the huge memory “leak”?

Any Lua object (typically tables) you create (or which is created by Corona) that you keep track of (like your stash) will take up memory until Lua can garbage collect it. 

So, if you’re holding on to a bunch of Lua table references, eventually you’ll start to soak up some real memory.

Now, with regards to closures… I’m less familiar with how their memory is managed, but I imagine the concept is similar.  Till Lua can garbage collect them, they will hang around too.

I suggest you avoid making multiple closures and dynamically generated functions.

Also, there should be no need to hold onto a transition return value beyond the end of the transition.