Game Development Reference
Usually when game developers look at hardware features, they tend to focus on the
CPU speed and graphics chip to assess what's technically possible. However, being
mobile devices, the iOS devices (until the most recent iPhone 4) are limited mostly by
the amount of available memory. This is also quite frequently underestimated by new
developers. For example, a 1000x1000 tilemap can easily consume several hundred
megabytes of memory, not counting the texture memory. And a 2048x2048 texture
with 32-bit color depth already consumes 16MB of memory, so you can't have too
many of them in memory at the same time.
Note Don't confuse RAM with the flash storage memory where MP3s, videos,
apps, and photos are stored, of which even the smallest iOS device has 8GB.
Flash storage memory is equivalent to the hard drive on your desktop computer.
RAM is the memory your application uses to store code, data, and textures
while it's running. When I talk about memory, I mean RAM.
About Memory Usage
Current iOS devices have between 256MB and 1GB of RAM installed. However, that's
not the amount of memory available to apps. iOS uses a big chunk of memory all the
time, and this is compounded by iOS multitasking introduced with iOS 4.
Over time, iOS developers have been able to close in on the theoretical maximum
amount of RAM an app can use before it's forcibly closed by the OS. Table
2-2 shows what you can expect to work with.
Memory Warning Threshold
Around 250MB (estimated)
Ideally, you want to keep your memory usage below the number in the Memory Warn-
ing Threshold column at all times. Around that point your app might start receiving
Memory Warning notifications. You can ignore Memory Warning Level 1 notifications,
but if the app continues to use more memory, you may get a Memory Warning Level 2
message, at which point the OS basically threatens to close your app if you don't free