Under the Hood: Insight into App Crashes - It’s all about the Memory

by qrayon 10. May 2010 00:00

In building Stickyboard and Quarter Shuffle, we’ve had to work very hard to optimize dynamic memory (RAM) usage on the iPad. Dynamic memory is not the same as storage memory (i.e. the 16GB, 32GB, 64GB of flash ram), which is analogous to hard drive storage on your laptop computer. All versions of the iPad contain only 256MB of dynamic memory, the same as the iPhone 3GS (the iPhone 3G only has half as much). In comparison, a typical laptop computer has 8 or 16 times that amount of RAM.

Actually, it’s worse than that. The base operating system on the iPad takes up over 100MB of that memory, which leaves around 150MB for services and Apps.

What makes things interesting is that certain built-in apps, namely Safari, Mail, and iTunes, actually run in the background and take up memory even when not active! Here’s a snapshot of one of our test iPad’s memory usage (using the Instruments tool):

image

Here, those 3 apps take up another 50MB of memory. After subtracting out all the other miscellaneous services (e.g. Bluetooth, DRM, location services, etc.), Apps are only left with around 50MB of memory to use. If an App ever tries to allocate more memory than what is available, it crashes, usually without warning.

The problem is that because background memory usage can vary quite a bit, it’s very hard for App Developers to predict what a safe maximum available memory is. For instance, you can see above that Stickyboard is taking up around 27MB of memory as a baseline. However, this can spike when loading boards, drawing lines, etc. In our testing, we’ve made sure not to exceed around 40MB of memory to leave a safe buffer. But if someone were to have a lot of tabs and complex pages open in Safari, or a large email active, available memory could possibly be lower than what is expected.

Tip: If you ever find your Apps frequently crashing on your iPad, try doing a hard reset. Hold down the Home and Power buttons down simultaneously for around 15 seconds until you see the Apple logo. This should reset background Apps enough to free the maximum RAM available.

 

Jailbreakers Beware

While we haven’t done any testing on Jailbroken iPads, we know that one of the top features is the ability to run apps in the background. This is going to dramatically reduce available memory for the foreground app! If you are running J/B, be careful about monitoring available memory. While we wish running any app in the background were possible today, it’s pretty clear that the planned multitasking services in iPhone OS 4 are the right way to deal with the very limited memory on the iPad and iPhone.

Let’s hope that the next version of the iPhone and iPad come with much more dynamic memory. Especially if the rumors about higher resolution screens and cameras are true, this will almost certainly require double or quadruple the RAM needed, just in order to deal with higher resolution images.

Quarter Shuffle is the #4 Top Free Simulation Game!

by qrayon 7. May 2010 23:41
Quarter Shuffle top 5 simulation

Thank you everyone who downloaded Quarter Shuffle! Extra thanks to you guys who rated it! Apps live and die by their ratings, so thanks for taking the time to write them. It also means a lot to us personally to hear your feedback. We really love to read them. It’s a really rewarding feeling to know that people enjoy playing it as much as we do!

Quarter Shuffle is now available in the App Store!

by qrayon 4. May 2010 19:35

Quarter Shuffle

We have cleared the final review process, and Quarter Shuffle should be live in the App Store in just a few minutes! Let’s see how long it takes you to get 400 points!

Quarter Shuffle is now in final Beta

by qrayon 23. April 2010 23:47

Quarter Shuffle banner 325x50

It’s getting close! We plan to submit the final build this weekend, which means that Quarter Shuffle should be available in the App Store as early as next week if all goes well. It’s been a fun journey getting to this point, and we are looking forward to sharing it with the rest of you.

Quarter Shuffle is the first game we’re releasing for the iPad, and doing it has been quite an eye opener to the platform for us. The iPad is going to be a game-changer (pardon the pun) for gaming. I don’t believe it’s going to replace other more portable gaming devices like the Nintendo DS and PSP, nor will if ever compete directly with console gaming. What it’s going to do is enable completely new, yet unseen, genres of games.

Quarter Shuffle is based on a relatively simple theme, but it is a game that could only have been created for the iPad. We have begun to only scratch the surface of multi-touch gaming. No doubt other teams of talented developers are working on their own masterpieces at this very moment. I’m personally looking forward to the day when we have a full-blown RTS on the iPad, but what will be more exciting are all the new genres of games that are now possible.

Powered by BlogEngine.NET 1.6.1.0 - based on Old School Theme by n3o Web Designers