Memory Rules on iPhone

April 18, 2009 § Leave a comment

iPhone 3D comes with 128MB of RAM. Majority of RAM is used by OS. This leaves about 40MB for your application. Even if you use 3MB of RAM, you will trigger the memory warnings.

  • no garbage collection
  • for every alloc, retain, copy, you will have to release the memory
  • no automatic objects to help manage memory
  • use autorelease with care as it leaks memory; autorelease will not release until the autorelease pool is released
  • no virtual memory or swap file

Good memory practices are here and here. Stanford Cocoa Programming Course class PDF is here. The offical Apple’s memory management practice is here.

Leave a comment

What’s this?

You are currently reading Memory Rules on iPhone at Web Builders.

meta