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.

Comments

7/25/2013 9:03:40 AM #

Mohammed

Free iTunes codes is our new website which we giveaway free itunes gift card codes to every one who visits our site. Our website gives the chance to everyone to get a free itunes code. We know that it looks impossible to your eyes that we offer so many free itunes codes, but it is not! Our advertisors and sponsors pay us for every download of a itunes code. We totally offer 27 itunes gift card codes daily. How are you supposed to know if there are still itunes codes left? Well, if you click on one of our itunes gift card codes you will see that every free itunes code is tagged with a text, telling if it is Claimed or not. Our system automatically mark every free itunes code who has been downloaded from other user as "Claimed iTunes Code". Note our system is not like a iTunes codes generator, because an iTunes codes generator will create their own codes, which is most likely fake. So if you want to get your free itunes gift card code, visit our download page and choose one of the free itunes codes!

By having a free itunes code you will be able to purchase items like music, movies, games and much more from iTunes store. As you can see you can choose admist three free itunes gift card codes values, 15$, 25$ and 50$. You can simply click on the "Select Button" and choose the free itunes code value you want. It is normal that most of you would prefer the 50$ free itunes codes, but we offer only 100 free itunes codes of 50$ daily, meaning that not all of you will have the chance to get a 50$ free itunes code. If there are no 50$ itunes gift card codes available, you can just for for the 15$ or 25$ itunes codes and wait for the next day for getting new one! How is it possible those itunes codes to be absolutely free? There is no catch. everything is free! If you notice, you will have to complete a short offer, which takes like 2 minutes to complete. Those offers are given from our advertisors and are what make our itunes codes free!

Our free itunes codes are of course safe to use! All our free itunes gift card codes are given from our advertisors, thing that makes them legit and unused! We manually check if all of our free itunes codes are unused and unique and check of they contain any harmful data. Your download will be in a zip file, so you will be able to virus scan it before you open it and the zip file will just contain a text file with the free itunes code.

Feel free to visit my web page :: free itunes redeem codes ( Mohammed - http://itunescards.pw/ )

Mohammed |

9/10/2013 9:41:35 PM #

criminal background check

Nowadays, it is a painless and quick thing to obtain facts about your potential hires. Especially the criminal records of any person would be very helpful for you because it would tell you whether you should be in association with a person or not. The exception to this requirement is Sex Offender Records, which you can search NATIONALLY with just a first and last name as well as Federal Inmate Records.

Here is my website -  criminal background check - http://www.backgroundsearchpro.com

criminal background check |

10/17/2013 10:38:36 AM #

Get your FREE Itunes gift cards here!

Howdy! I know this is kind of off topic but I was wondering which blog platform are you using for this site? I'm getting sick and tired of Wordpress because I've had problems with hackers and I'm looking at alternatives for another platform. I would be great if you could point me in the direction of a good platform.

Also visit my web site:  Get your FREE Itunes gift cards here! - http://www.youtube.com/watch?v=TY6F5S53Lyc

Get your FREE Itunes gift cards here! |

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