Thursday 11 June 2009

Iphone and memory management

Ok, I was busy with some iPhone related developments. Now I realized that the actual memory size of an iPhone is 128 Mb RAM (memory you can use for application, not storage).
So this means that your application, usually can't take more than 50 to 60 Mb of RAM.
For myselfs I've put some guidelines to manage that limitation :

1. Never use more memory than needed for the view you are in, so release, release

2. Every viewcontroller should be released as soon it's pushed in a navigation controller

3. Use proxy's (lazy object creation)

4. use SQLite for caching (store your objects in a SQLLite database, this database is not using   RAM)

5. Prepare your application for the worsed and implement the didRecieveMemoryWarning method

No comments:

Post a Comment