views:

90

answers:

5

My app crashed because of Low Memory. I'm not sure if its entirely my fault because it lists about 7 or 8 other applications that crashed alongside? How should I handle this?

Incident Identifier: 2CC74C33-179F-4CD2-8FAA-00CF0A344749
CrashReporter Key:   1657e021ecba3a19c5ed9f0cff62947a426a2bc2
Hardware Model:      iPhone3,1
OS Version:          iPhone OS 4.1 (8B117)
Date:                2010-10-24 12:20:38 +0100
Time since snapshot: 2044 ms

Free pages:        1329
Wired pages:       21508
Purgeable pages:   0
Largest process:   Instagram

Processes
         Name                 UUID                    Count resident pages
       securityd <3dcc6e23849cb3ee197720700284156d>     309
        sandboxd <4c01175d65fe7efb292e307389d3387b>     178
     ReportCrash <2ad0d335f1b93cc74e0b5be79850229d>     255
mDNSResponderHel <a0d7f455b6f2069587ea7bc956d79655>      70
          Stocks <55e537a6739e58dc068e1436930213ba>    1162
    mediaremoted <507d59f44f735d6e2855b23a6275557a>     216
MobileMusicPlaye <02ed082c795446617957bbae8974a2c8>    1052
     dataaccessd <40c418e18e9bbd950ef7e3fb593645de>     618
             spd <6419715f9e6891201e16b722fca84793>     126
      MobileMail <215c71d2434ce352d04786b93cda5340>    2483
      calaccessd <90c4c48a02f0dbf0d1adaad27b8d5945>     427
       MobileCal <db3e6efa621fc989420ccc43298d5b80>    1619 (jettisoned)
      StockTwits <3786112667f535bff10bb6f7966bb852>    2067 (jettisoned)
        Mint.com <0f38a50fd98c755ef34e0fe8b0c25adc>    4461 (jettisoned)
        AppStore <99bf23a9224aa148ac3e009873f9c7b9>     998 (jettisoned)
          Reeder <dcb69039fa5b4426b3db9f9920054f3e>    5835 (jettisoned)
           Meebo <22f145af489fb92066006a5a3cac813a>    3684 (jettisoned)
    MobileSafari <67a5ebc3754e0ce1e482760c7e56f9c5>    3512
           Skype <d570c35d6d2f51713e874937dd8112f4>    4769
        Facebook <ae1fa9da7f8951ffbf693bbd0ed36aaf>    2459 (jettisoned)
     MobileTimer <98640aaee653fc9188652d6cdab13d67>    1294 (jettisoned)
         Twitter <62edb7ce453c603ad1b8b3bdcbc4910b>    5843
 MobileSlideShow <40eded841026ed418bebe49a342f2c8f>    3566
       Instagram <25e2a98b5d3de6f2cf2f246df8a49a9d>   11523 (active)
            misd <d9b8f85780f931007d309fc836185ab0>     119
MobileStorageMou <bd2184fe17b3c9ccbadd9120bd669c99>     102
     Preferences <9123dcc666c97bb1d63a5921968c8b34>    1666
     MobilePhone <b50b6283b8c52a51fb9e48ee5c909b80>     804
         imagent <4ef86a68405738280f19e5fbc0af56db>     291
             lsd <4fb2cf7b5475b39b2c56d9588821eb45>     157
        SCHelper <30ca097cbb6306cf66157da7fd4de07c>     110
         notifyd <ab40010781bef81228df18acf1acdbb2>     129
        BTServer <ce7c062b4df09b835c77a6086b7ef0d8>     136
      CommCenter <a8a6257faa2a5213f0a2f5c763f9acfe>     335
     SpringBoard <983033e585706c1c6c99eed85cd8dbdb>    8315 (active)
      accessoryd <b99ccd1b099c015edb93e8d1cbf03e36>     109
            apsd <f031a0e787d8840097a4812fb1c89f5e>     240
        awd_ice3 <b598d42ac4fdd950ac5c2c9a1835f70e>     124
         configd <b2b3af98743381e759dd5b17115a0378>     548
   fairplayd.N90 <3ae05b3bbcb034b0d4d4712e8fc19f99>      95
       locationd <963c5d93cfaf1b1139045b1658ecfc26>    1031
   mDNSResponder <68dc311f118d171ede7b91f43c323b7d>     235
    mediaserverd <3ebe3a043c2dba96b70d8ede30bcb6ab>    1220
       lockdownd <bfeda752b819f06f4828e112d3ca695c>     326
         syslogd <60e8005a73e76d6ee81a8b45a9443a16>      94
         launchd <b15ff1a8f2f37c3b0df0343899757b17>     103

**End**
A: 

I doubt you can. Always check the return value of your allocations, free up memory when you're done, use as little memory as possible, and (I don't remember if this'll work on iPhones) run valgrind to find any memory leaks in your app

Shaun
+1  A: 

Make sure you fixed all leaks in your app with instruments and with X-code's built-in slangs analyzer.
Run your app as much as time possible with instruments.release all instance variables in dealloc methode and make sure you are reacting to didRecieveMemoryWarning:.
put a breakpoint in didRecieveMemoryWarning: then you can confirm that it is your fault.

Aji
A: 

By the time iOS decides to terminate your app it's already too late.

Instead, if you application is active, you need to shed any memory you don't need when you receive the applicationDidReceiveMemoryWarning: message in the UIApplicationDelegate or the equivalent notification.

To minimise the chance of your app being expelled from memory when another app uses too much, all you can do is release any data you can recreate when it goes into the background (pretty much the same process you should be going through when memory is low).

However, you can't ever guarantee that you'll never be terminated.

Stephen Darlington
Actually, it is showing Instagram (not my app) as active. My app was jetissoned.
Sheehan Alam
You didn't say which your app was and I assumed it would be the active one. My bad. I have updated my answer taking that new information into account.
Stephen Darlington
A: 

I had a similar problem with an app of mine crashing on a low memory warning. I was already freeing up memory in the didReceiveMemoryWarning delegate methods but it was still crashing.

Eventually I commented out the [super didReceiveMemoryWarning] in my RootViewController (I had created my app using the navigation app template). I think the crash was occurring because the RootViewController was being released in that call.

acqu13sce
That's not what's happening here, though. The crash report shows that the OS it terminating the app because it's short of memory.
Stephen Darlington
+2  A: 

This is expected behavior. Background apps continue to run only at the frontmost app's leisure. If the frontmost app decides it wants your resources, you have no choice but to give them up immediately.

Chuck