People have issues with scale maybe this will help.
There are two types of memory in our apps. Lua memory and Texture Memory. Lua memory is your variables, your tables and strings. Texture memory is anything big like an image, a sound or a sprite sheet.
The code that gets the Lua memory returns it in “Kilobytes” or in other words, you need to multiply it by 1024 to get the amount of memory in use.
The code that gets you the texture memory returns bytes, so you don’t need to multiply it by anything to get it on the same scale as the Lua memory.
Your phone or tablet probably has a minimum of:
256,000,000 bytes of available memory up to
1,024,000,000 bytes.
Of course not all of that is free for your app, but you should reasonably have access to half that.
If the Lua memory is returning say 250 as its number, then its using:
250,000 bytes. A trivial fraction of your available memory.
Texture memory is what eats up large amounts of memory.
I don’t worry about the amount of Lua memory (returned by gcinfo()). What I worry about is it going up and and up and never going down. That’s the sign of a memory leak.
Your big leaks though are likely going to be blocks of texture memory and since they can on scale be in the:
1,000,000+ range
It doesn’t take to many of those to run you out of memory.
[import]uid: 19626 topic_id: 19331 reply_id: 74609[/import]