levels - memory management tips

Hi all, I'm going to release my first game very soon and am trying and optimize the code before sending to the App Store.

My game is made of 10 levels and I would like to clear the memory and remove all the objects before passing from one level to another. In particular I have a main.lua being the level 1 and then calling level 2. Level 2 calls level 3 and so on.

How do you optimize memory usage? Indexed tables create 10 times the amount of data I need. On the other hand, initializing the same variables level after level is the easiest way but at what cost?

Thanks in advance for your tips.

Put necessary local (!!!) variable into database, clear all, load next level and variable fron database.

views:1420 update:2011/11/17 9:28:17
corona forums © 2003-2011