8
votes

so heres the story, Apple recently rejected my app, saying it crashed on their phones, (iPhone 3G and ipod touch 2g), and send me two crash logs. NEITHER of which I can make sense out of.

Here they are.

 Incident Identifier: BA4382DD-DA6A-47F7-800D-43AD30919064
 CrashReporter Key:   53e41ca2a52f91affddc86f49ce9c4be851fcfd6
 OS Version:          iPhone OS 3.1.2 (7D11)
 Date:                2010-01-14 15:59:57 -0800

Free pages:        317
Wired pages:       11274
Purgeable pages:   0
Largest process:   iConicCars

Processes
         Name                 UUID                    Count resident pages
       amfid <b4f3e5a61456edf85b6ada59064ec311>      93
  iConicCars <851d264eb074e465891dcd67b67a8e79>    5928 (jettisoned) (active)
  MobileMail <0798395dde43ca46317db6e674dfbbfd>     503 (jettisoned)
 MobilePhone <82c9bd8583f4b09706a16b08e641a4b9>     464 (jettisoned)
     notifyd <d6b12a4e424e10e5ce91efd8d39f22af>      77
    BTServer <c940c4c7252113a7303cc1f7d1429c17>     253
  CommCenter <b1d6c4fe3ce2bc0374471196ab15b8d4>     313
 SpringBoard <c5c29b56a2bb445fc73203e03f67fa78>    1954 (active)
  accessoryd <32ceed5c3c32625ac23cd870f61364af>     107
     configd <aae411e8289912124271f109ceee8f85>     290
   fairplayd <cdce5393153c3d69d23c05de1d492bd4>     156
   mDNSResponder <db98efaea94329959789f73a16f9f46e>     123
mediaserverd <612fbbfa0546609cf6c6b13ae6f333cf>     767 (jettisoned)
   lockdownd <171865bfe3725c3d5047df8c00ed5d77>     294
     syslogd <1cb3e9f2375fad9e345bd16655be4a50>      66 (jettisoned)
     launchd <c5bc115d47313218505394f96770782a>      76

**End**

Incident Identifier: 8E52889B-0260-4AAD-A39C-FC170FB637D4
CrashReporter Key:   45d118e8a4be9b3163eab905af870f05dfddb12d
OS Version:          iPhone OS 3.1.2 (7D11)
Date:                2010-01-14 13:41:31 -0800

Free pages:        309
Wired pages:       12550
Purgeable pages:   0
Largest process:   iConicCars

Processes
         Name                 UUID                    Count resident pages
      iConicCars <851d264eb074e465891dcd67b67a8e79>    5641 (jettisoned) (active)
       SCHelper <b87bd080a670f9512426e8721dc1f03c>     103
            misd <a41e5d5f4b8922ab272c55df84aec4fd>     140
    installd <620ede129454bcd824f0b6cec13b15d3>     212
 SpringBoard <c5c29b56a2bb445fc73203e03f67fa78>    1545 (jettisoned) (active)
        iapd <fea164e93479b90e1dd39a293dd3865c>     251 (jettisoned)
     syslogd <1cb3e9f2375fad9e345bd16655be4a50>      83 (jettisoned)
mediaserverd <612fbbfa0546609cf6c6b13ae6f333cf>     302 (jettisoned)
    BTServer <c940c4c7252113a7303cc1f7d1429c17>     345
   lockdownd <171865bfe3725c3d5047df8c00ed5d77>     279
     notifyd <d6b12a4e424e10e5ce91efd8d39f22af>     104
  CommCenter <b1d6c4fe3ce2bc0374471196ab15b8d4>     151
     configd <aae411e8289912124271f109ceee8f85>     264
   fairplayd <cdce5393153c3d69d23c05de1d492bd4>     517
   mDNSResponder <db98efaea94329959789f73a16f9f46e>     100
     launchd <c5bc115d47313218505394f96770782a>      67

**End**

they said even after a reboot, there is no difference. Heres the kicker, it works perfectly on my iPhone 3GS, and in the simulator with NO memory leaks.

So, what on earth do i do?

UPDATE:

Log for in the simulator [Session started at 2010-01-16 20:01:44 +1300.] GNU gdb 6.3.50-20050815 (Apple version gdb-1346) (Fri Sep 18 20:40:51 UTC 2009) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all Attaching to process 1152. dyld: could not load inserted library: /usr/lib/libgmalloc.dylib

Data Formatters temporarily unavailable, will re-try after a 'continue'. (Cannot call into the loader at present, it is locked.) warning: Couldn't find minimal symbol for "_sigtramp" - backtraces may be unreliable Cannot access memory at address 0x0 Cannot access memory at address 0x0 (gdb)

5
UPDATE : I have 2.8 mbs of images stored in an array in the app - would this be bad? I have sumbmitted, and got through a similar app, that just uses smaller pictures. - Sam Jarman
2.8MBs on the file system (as in in JPG size)? Because once loaded they are a LOT larger in memory. You can have larger pictures, but you may need to re-work your app to load images only as needed. - Kendall Helmstetter Gelner
the folder of images on the desktop is 2.8 megs. - Sam Jarman
this seems to be a tricky one. I have another app (in the app store -c alled structures). and it makes u guess the building on showing a little bit of the image. this is just a re-has of it but done with images and names of cars. And the structures one was accepted, and not this one. its images are 4.5mbs in total, and there are fewer of them. - Sam Jarman
is it because im sending things to the log at times? - Sam Jarman

5 Answers

5
votes

See "free pages: 309"? not good, means you are using a bunch of memory then when it is all used it crashes. And the purgeable pages = 0 is memory that can't be reclaimed so it's a memory issue.

Do a "Build and Analyze" and run "Leaks" to find memory leaks and places you can run more efficiently.

5
votes

As others have said, you are using too much memory.

If you are using multiple pages of view controllers, try this simple test - run your app with the ObjectAlloc Instrument. Click on something to bring up a subview, you should see your memory increase - now dismiss that view and go back to the main one, the memory should go down. If it does not, that is your problem (or one of them anyway, but that is a likley starting point).

To try and track this down, place breakpoints in dealloc for each of your view controllers and see what actually gets called. For view controllers that are not released like you expect, in ObjectAlloc you can see where each retain against an object was issued, and decide what retained the object when it should not have done so.

In general the ObjectAlloc flow should look like a graph that goes up and down all the time, not constantly rising.

Also if you are using a lot of images consider re-sizing them to the exact size you need instead of starting with a much larger size and scaling. Using that much memory must be due to using images and not releasing them. Leaks will not report anything if you still have references to memory you are retaining.

Also, buy an older Touch for testing.

3
votes

Your app used too much memory. Check your app with Instruments (Object Allocations or Leaks) and see if you can reduce memory allocation.

3
votes

Your iPhone 3GS and the Simulator have far more memory than the other iPhone OS devices. To work on all devices, you should use no more than 20 MB of memory.

2
votes

You app is using way, way too much memory. It'll never run on older devices with 128 MB of RAM.