Search code examples
ipadmemory-leaksmemory-managementinstrumentsactivity-monitor

iPad: Activity monitor's "Real Memory" v. application memory usage?


I am helping a friend hunt down a crash in an iPad application he has written. The application is pretty straightforward, transitioning between UIViews under a single UIViewController as the user goes forward and backwards through pages. The crash is pretty hard, and doesn't drop us in the debugger or anything- the app just dies. In the console the infamous 'signal "0"' message is posted, which according to this question is most likely due to the OS killing the app over memory consumption.

The memory allocations are pretty constant, well below any limits imposed by the device: Instruments memory allocations and leaks

According to the Allocation and Leaks instruments the total number of allocations maxes out around 2MB or so- well below any hardware/OS limits. However when we run the app on the device with the Activity Monitor instrument the Real Memory used by the application is topping out around 150MB, which we suspect to be the cause of the application's death by the OS.

What is to account for the glaring discrepancy between these two figures?


Solution

  • For some reason [UIImage imageNamed:] wasn't caching properly. Switching to another API to load the images resolved the issue.