Don’t panic, but also don’t ignore It
We show these memory alerts for a reason and we want you to understand what they mean. The Apple iOS is designed to maximize application performance within the confines of limited computing capacity. Unlike a desktop computer, our iPhones and iPads contain much less physical RAM memory and therefore must use a system to distribute and manage that memory between the internal system operations, the active application, and background applications.
It is normal for iOS applications to receive memory warnings from the operating system. Developers are responsible for creating mechanisms to accept these messages and reduce memory usage wherever possible to ensure that the active application has the maximum amount of memory available to it. However, this memory juggling act doesn’t always work out perfectly. When it doesn’t, the user may notice apps slowing down or even crashing because they don’t get the memory they need to function.
Chronic Pain Tracker has a number of internal mechanisms to deal with these memory warnings, and in most cases, you’ll not even know that they are going on. However, we have enabled our app to alert users when the warnings are received. This gives the user the chance to be aware of what is going on, and to even assist in ensuring the app has the necessary memory available to run at peak performance.
The information below will explain what the warnings mean and the situations/triggers that can cause them to occur.
Device Capacity ≠ Application RAM
The low memory message that Chronic Pain Tracker displays is in response to the Apple iOS sending a warning to our application to say that the device is running low on memory. The memory that is referred to here is not the same as disk space. For example, we often refer to an iPhone with 16GB of “memory” (Apple likes to call it capacity), but this is actually the storage space on the device. In desktop computer terms, you can think of this as the space available on your hard drive.
The actual memory in these devices is on the order of 256MB, or 512MB in some of the newer models (see the table to the right). So, when we talk about a low memory warning, keep in mind that it does not relate to how much “capacity” or storage space you have left on your device. Instead it is referring to the available RAM.
Multi-tasking & Background Applications
Apple’s new iOS 4.x has also complicated matters a bit with its new “multi-tasking” capability. Although not true multi-tasking in the sense of a desktop operating system, this new feature means that applications can be kept active in the background while working with another application. These background apps utilize the same application RAM that the active app uses, so if you have lots of apps sitting in the background, it’s quite possible that the active app will not have enough RAM left to run properly and the warning will be generated.
Here’s an example of that situation using a utility application to check the device memory. In the first screenshot you can see that although the device has more than 500 MB of physical memory, only 16.78 MB are free at the current time. Memory intensive applications that try to run now will likely receive one or more Device Low Memory warnings. The second screenshot shows the same device after the background applications have been exited. Now you can see that more than 245 MB or RAM is available for new applications to use.
How to really exit an application?
Normally, when you want to quit an application, you tap the \”Home\” button and you’re taken back to your device desktop where you can launch your next application. But did you really exit the application? With Apple’s latest iOS 4.x, that application is probably still sitting in the background using memory. Developers have the option of determining what will happen when you tap the \”Home\” button, and in most cases you’ll see them take advantage of the multi-tasking capability. And let’s face it, its nice to be able to jump back and forth between apps without having to restart them every time. But the downside is the fact that those background apps still consuming RAM memory.
To truly exit an application and free that RAM for your next application is to double click the \”Home\” button. Along the bottom row, you’ll see the icons of the apps that are currently suspended in the background. Tap and hold on one of them to bring up the red close symbol over each icon. Tap the close symbol for each of the apps shown. Now those apps are finally closed and the memory has been freed.
Even better – Reboot the Device
A periodic reboot of your device can often be a great cure-all for application bugs and memory warnings. It gives the device a chance to completely clear out bits of memory, temp files, caches, etc that take away from the RAM available to applications. Most applications, even device operating systems, are going to occasionally leak memory. This is when a program claims a portion of RAM for itself, but then forgets that it owns it. Even though the application may be exited, the operating system thinks that bit of memory is still owned by an app and won’t release it. All developers try to eliminate leaks, but they do happen.
Here’s another example. In the above figures, exiting background apps increased Free RAM from 16.8 MB to 245.5 MB. We then rebooted the device and checked the RAM status again (see below). Now there is more than 326 MB free for apps to utilize.
NEW – Preference Setting to Adjust Memory Warning Alerts
With v2.5.7 we introduced a new prefernce setting which let’s you determine whether or not the application presents you with the Memory Warning alert message. The application will still work behind the scenes to adjust for an optimal memory footprint. The preference only determines whether or not the user will be notified that the warning was issued.
To find this new preference, from within Chronic Pain Tracker, go to the Settings tab and then tap Application Info. Scroll down until you see the section for Device Memory Warnings. Tap the Alert Options button to open the selection window. The default setting is to only notify the user if multiple Device Memory Warnings are received during a short period of time. This usually indicates a situation where the problem is with background applications not freeing enough memory for optimal operation, so it seems to be a valid time to notify the user. That said, if you’d rather just ignore the alerts, we do have a setting where you can turn the notifications off completely. Its up to you.
Chronic Pain Tracker & Memory Warnings
Okay, so hopefully that helps explain what the memory warnings are and some of the ways to make more RAM available to your applications. When you see a memory warning in Chronic Pain Tracker, don’t ignore it. We show it so that you can avoid any data loss that might be caused by a crash (should the memory situation not be resolved) and as a reminder to periodically close apps and reboot your device so that things will run smoothly and quickly.
If you continue to get these Low Memory Warnings, for example right after a reboot you start the app and the message comes right up, then let us know. There may be more going on than just a bit of memory hogging. You can reach us using one of our Support Request options.
Over the last few months we have been working very hard to reduce the memory footprint and correct any leaks within the application. We hope that you’re seeing those results as a more stable platform for tracking your pain. Our statistics tracking does suggest that application stability has increased quite a bit with the latest releases.