XCODE App has memory crash after

-1

I have a problem, I have written my first app which is just about finished.

There is one VC (the start up) with a button to take the user to a game in another VC.
The user can return to the first (menu) VC by clicking on a button in the second VC.

During testing i noticed that when the home button is clicked and then the app is bought back into view and the PLAY button is clicked the app crashes and the device restarts.

To try and isolate the cause, i removed the iAD and Games Centre from the game VC. The same problem occurs but now only after repeating the home button/bring back to focus/PLAY around 2-3 times.

Below is the device console but I'm new to this so its not clear to me.

When it crashes it shows the second VB for a millisecond or partly displays before it crashes.

From what it can read online something is using a lot of memory but i cant see anything in the code (viewdidload etc).

I ran the Analyze and only Dead stores were detected.

I cant emulate the same problem on the simulator, it only occurs on the devise (iPhone 3). I suspect because the Mac has more memory.

When i use the Analyse Instrument it doesn't show any spike in memory.

Please let me know if you need any other information. I've "nutted" out a lot of problems to this point, I cant wait to get it into the store!!

Sep 18 13:08:38 Andys-iPhone mobile_house_arrest[178] <Error>: Max open files: 78
Sep 18 13:08:41 Andys-iPhone installd[53] <Error>: 0x2ff5e000 handle_install: Install of "/var/mobile/Media/PublicStaging/levelword.app" requested by mobile_installation_proxy
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: 0x2ff5e000 MobileInstallationInstall_Server: Installing app com.margiesparrow.wribble
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: profile not valid: 0xe8008012
Sep 18 13:08:42 Andys-iPhone installd[53] <Error>: 0x2ff5e000 install_embedded_profile: Could not install embedded profile: 0xe8008012
Sep 18 13:08:43 Andys-iPhone installd[53] <Error>: Sep 18 13:08:43  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Sep 18 13:08:44 Andys-iPhone SpringBoard[76] <Warning>: Killing com.margiesparrow.wribble for termination assertion
Sep 18 13:08:45 Andys-iPhone lsd[86] <Warning>: updating identifier store
Sep 18 13:08:45 Andys-iPhone kernel[0] <Debug>: launchd[181] Builtin profile: syncdefaultsd (sandbox)
Sep 18 13:08:45 Andys-iPhone lsd[86] <Warning>: Attempting to store identifiers file
Sep 18 13:08:45 Andys-iPhone installd[53] <Error>: 0x2ff5e000 MobileInstallationInstall_Server: Staging: 0.45s; Waiting: 0.04s; Installation: 3.22s; LS Sync: 0.01s; Overall: 4.02s
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Warning>: SSSQLiteDatabase: Could not setup database: [14, /var/root/Library/com.apple.itunesstored/kvs.sqlitedb]
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Notice>: 014c4000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/downloaded-apps -> (null)
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Warning>: SSSQLiteDatabase: Could not setup database: [14, /var/root/Library/com.apple.itunesstored/kvs.sqlitedb]
Sep 18 13:08:48 Andys-iPhone lockdownd[43] <Notice>: 014c4000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/downloaded-apps -> (null)
Sep 18 13:08:48 Andys-iPhone mobile_assertion_agent[110] <Notice>: service_one_connection: Connection closed for client iTunes.
Sep 18 13:08:53 Andys-iPhone recentsd[186] <Notice>: 0x1dd0cf30|EAS|Note |EAS Protocol Manager set to ASProtocolUnknown
Sep 18 13:08:55 Andys-iPhone installd[53] <Error>: 0x2ff5e000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1e551bc0 [0x3a38a100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3a3769f4 [0x3a38a100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1e5a4360 [0x3a38a100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3a377a44 [0x3a38a100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1e5a47d0 [0x3a38a100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3a374794 [0x3a38a100]>{contents = "DTCompiler"}
        5 : <CFString 0x3a376564 [0x3a38a100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3a377224 [0x3a38a100]>{contents = "DTSDKName"}
        7 : <CFString 0x1e551050 [0x3a38a100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3a373eb4 [0x3a38a100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3a37be84 [0x3a38a100]>{contents = "DTXcode"}
        13 : <CFString 0x3a37beb4 [0x3a38a100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3a379304 [0x3a38a100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1e54fbb0 [0x3a38a100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1e5a2180 [0x3a38a100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3a377e54 [0x3a38a100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3a37abf4 [0x3a38a100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3a37bc84 [0x3a38a100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1e5a2010 [0x3a38a100]>{contents = "DTSDKBuild"}
    }
Sep 18 13:08:58 Andys-iPhone installd[53] <Error>: 0x2ffe0000 filter_attributes: Info.plist keys requested via MobileInstallationLookup/Browse in client Xcode (via mobile_installation_proxy) were not found in MobileInstallation's cache. Please file a bug requesting that these keys be added: <CFBasicHash 0x1e577ba0 [0x3a38a100]>{type = mutable set, count = 18,
    entries =>
        0 : <CFString 0x3a3769f4 [0x3a38a100]>{contents = "CFBundlePackageType"}
        1 : <CFString 0x1e54fbb0 [0x3a38a100]>{contents = "BuildMachineOSBuild"}
        2 : <CFString 0x3a377a44 [0x3a38a100]>{contents = "CFBundleResourceSpecification"}
        3 : <CFString 0x1e553e70 [0x3a38a100]>{contents = "DTPlatformBuild"}
        4 : <CFString 0x3a374794 [0x3a38a100]>{contents = "DTCompiler"}
        5 : <CFString 0x3a376564 [0x3a38a100]>{contents = "CFBundleSignature"}
        6 : <CFString 0x3a377224 [0x3a38a100]>{contents = "DTSDKName"}
        7 : <CFString 0x1e59f6c0 [0x3a38a100]>{contents = "NSBundleResolvedPath"}
        8 : <CFString 0x3a373eb4 [0x3a38a100]>{contents = "UISupportedInterfaceOrientations"}
        10 : <CFString 0x3a37be84 [0x3a38a100]>{contents = "DTXcode"}
        13 : <CFString 0x3a37beb4 [0x3a38a100]>{contents = "CFBundleInfoDictionaryVersion"}
        16 : <CFString 0x3a379304 [0x3a38a100]>{contents = "CFBundleSupportedPlatforms"}
        17 : <CFString 0x1e59fb10 [0x3a38a100]>{contents = "DTXcodeBuild"}
        18 : <CFString 0x1e5a2480 [0x3a38a100]>{contents = "UIStatusBarTintParameters"}
        19 : <CFString 0x3a377e54 [0x3a38a100]>{contents = "DTPlatformVersion"}
        20 : <CFString 0x3a37abf4 [0x3a38a100]>{contents = "DTPlatformName"}
        21 : <CFString 0x3a37bc84 [0x3a38a100]>{contents = "CFBundleDevelopmentRegion"}
        22 : <CFString 0x1e5a4360 [0x3a38a100]>{contents = "DTSDKBuild"}
    }
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: debugserver-199 for armv7.
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Connecting to com.apple.debugserver service...
Sep 18 13:08:58 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Got a connection, waiting for process information for launching or attaching.
Sep 18 13:08:58 Andys-iPhone kernel[0] <Debug>: lockbot[176] Builtin profile: debugserver (sandbox)
Sep 18 13:08:58 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.margiesparrow.wribble[0xab5][189]) <Warning>: (UIKitApplication:com.margiesparrow.wribble[0xab5]) Spawned and waiting for the debugger to attach before continuing...
Sep 18 13:08:58 Andys-iPhone amfid[190] <Error>: Sep 18 13:08:58  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Sep 18 13:08:59 Andys-iPhone kernel[0] <Debug>: launchd[189] Builtin profile: container (sandbox)
Sep 18 13:08:59 Andys-iPhone kernel[0] <Debug>: launchd[189] Container: /private/var/mobile/Applications/91C0CC2E-FD86-4606-9050-E9F17BFF0DA9 (sandbox)
Sep 18 13:08:59 Andys-iPhone com.apple.debugserver-199[188] <Warning>: Got a connection, waiting for debugger instructions.
Sep 18 13:09:02 Andys-iPhone kernel[0] <Debug>: AppleSerialMultiplexer: mux-ad(eng)::setLinkQualityMetricGated: Setting link quality metric to 50
Sep 18 13:09:10 Andys-iPhone levelword[189] <Warning>: Number of words loaded from words.txt:178694
Sep 18 13:09:20 Andys-iPhone mediaserverd[38] <Notice>: 2013-09-18 01:09:20.307416 PM [AirPlayScreenClient] ### Screen not supported on this device (iPhone2,1)
Sep 18 13:09:22 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:09:22 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:09:31 Andys-iPhone profiled[78] <Notice>: (Note ) profiled: Idled.
Sep 18 13:09:31 Andys-iPhone profiled[78] <Notice>: (Note ) profiled: Service stopping.
Sep 18 13:09:33 Andys-iPhone kernel[0] <Debug>: AppleSerialMultiplexer: mux-ad(eng)::setLinkQualityMetricGated: Setting link quality metric to 100
Sep 18 13:09:55 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:09:58 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:09:58 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:10:01 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.BlueTool[69]) <Notice>: (com.apple.BlueTool) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.BlueTool[69]) <Notice>: (com.apple.BlueTool) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.deleted[56]) <Notice>: (com.apple.mobile.deleted) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.deleted[56]) <Notice>: (com.apple.mobile.deleted) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.xpcd.F5010000-0000-0000-0000-000000000000[92]) <Notice>: (com.apple.xpcd.F5010000-0000-0000-0000-000000000000) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.crashreportcopymobile[120]) <Notice>: (com.apple.crashreportcopymobile) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.crashreportcopymobile[120]) <Notice>: (com.apple.crashreportcopymobile) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.assetsd[101]) <Notice>: (com.apple.assetsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.assetsd[101]) <Notice>: (com.apple.assetsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.timed[16]) <Notice>: (com.apple.timed) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.timed[16]) <Notice>: (com.apple.timed) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[58]) <Notice>: (com.apple.coreservices.appleid.authentication) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.coreservices.appleid.authentication[58]) <Notice>: (com.apple.coreservices.appleid.authentication) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.itunesstored[74]) <Notice>: (com.apple.itunesstored) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.itunesstored[74]) <Notice>: (com.apple.itunesstored) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.assertion_agent[110]) <Notice>: (com.apple.mobile.assertion_agent) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.assertion_agent[110]) <Notice>: (com.apple.mobile.assertion_agent) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.accountsd[84]) <Notice>: (com.apple.accountsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.accountsd[84]) <Notice>: (com.apple.accountsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.recentsd[186]) <Notice>: (com.apple.recentsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.recentsd[186]) <Notice>: (com.apple.recentsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.lsd[86]) <Notice>: (com.apple.lsd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.lsd[86]) <Notice>: (com.apple.lsd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.installd[53]) <Notice>: (com.apple.mobile.installd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.mobile.installd[53]) <Notice>: (com.apple.mobile.installd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.networkd_privileged[70]) <Notice>: (com.apple.networkd_privileged) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.networkd_privileged[70]) <Notice>: (com.apple.networkd_privileged) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.softwareupdateservicesd[97]) <Notice>: (com.apple.softwareupdateservicesd) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.softwareupdateservicesd[97]) <Notice>: (com.apple.softwareupdateservicesd) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.gamed[79]) <Notice>: (com.apple.gamed) Idle-exit job was jettisoned. Will bypass throttle interval for next on-demand launch.
Sep 18 13:10:01 Andys-iPhone com.apple.launchd[1] (com.apple.gamed[79]) <Notice>: (com.apple.gamed) Exited: Killed: 9
Sep 18 13:10:01 Andys-iPhone SpringBoard[76] <Warning>: Received memory warning.
Sep 18 13:10:01 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:02 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:02 Andys-iPhone ReportCrash[195] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Sep 18 13:10:02 Andys-iPhone ReportCrash[195] <Notice>: Not saving suspended-only Jetsam log because already dumped today.
Sep 18 13:10:02 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:02 Andys-iPhone levelword[189] <Warning>: Received memory warning.
Sep 18 13:10:10 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:10:10 Andys-iPhone levelword[189] <Warning>: tgvc applicationdidenterbackground
Sep 18 13:10:12 Andys-iPhone ReportCrash[196] <Notice>: Not saving Jetsam log because no data from the kernel.
Sep 18 13:10:14 Andys-iPhone levelword[189] <Warning>: drawBackground
Sep 18 13:10:14 Andys-iPhone levelword[189] <Warning>: showLevelPopUp
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.apple.mobilephone[0x955][96]) <Notice>: (UIKitApplication:com.apple.mobilephone[0x955]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (com.apple.TextInput.kbd[50]) <Notice>: (com.apple.TextInput.kbd) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (com.apple.tccd[93]) <Notice>: (com.apple.tccd) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.margiesparrow.wribble[0xab5][189]) <Notice>: (UIKitApplication:com.margiesparrow.wribble[0xab5]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone com.apple.launchd[1] (UIKitApplication:com.apple.mobilemail[0x60e][99]) <Notice>: (UIKitApplication:com.apple.mobilemail[0x60e]) Exited: Killed: 9
Sep 18 13:10:17 Andys-iPhone UserEventAgent[13] <Notice>: jetsam: kernel termination snapshot being created
Sep 18 13:10:17 Andys-iPhone com.apple.debugserver-199[188] <Warning>: 1 +0.000000 sec [00bc/1303]: error: ::read ( 5, 0x2fe809fc, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.apple.mobilephone[0x955]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.margiesparrow.wribble[0xab5]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:18 Andys-iPhone backboardd[26] <Warning>: Application 'UIKitApplication:com.apple.mobilemail[0x60e]' exited abnormally with signal 9: Killed: 9
Sep 18 13:10:22 Andys-iPhone ReportCrash[203] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system 

version dictionary

I look forward to any help you can give.

Kind regards Andy

ios
objective-c
xcode4.6
asked on Stack Overflow Sep 18, 2013 by Andy Sparrow

1 Answer

1

"I ran the Analyze and only Dead stores were detected." Fix them. Fix all warnings. Run Instruments, allocation tool. You should not see memory continuing to increase. If it is use Heapshot analysis:

Use instruments to check for leaks and memory loss due to retained but not leaked memory. The latter is unused memory that is still pointed to. Use Heapshot in the Allocations instrument on Instruments.

For HowTo use Heapshot to find memory creap, see: bbum blog

Basically there method is to run Instruments allocate tool, take a heapshot, run an intuition of your code and another heapshot repeating 3 or 4 times. This will indicate memory that is allocated and not released during the iterations.

To figure out the results disclose to see the individual allocations.

If you need to see where retains, releases and autoreleases occur for an object use instruments:

Run in instruments, in Allocations set "Record reference counts" on on (you have to stop recording to set the option). Cause the picker to run, stop recording, search for there ivar (datePickerView), drill down and you will be able to see where all retains, releases and autoreleases occurred.

Also consider Xcode 5, run the app, select the Debug Navigator, select Memory and watch what is happening with memory.

answered on Stack Overflow Sep 18, 2013 by zaph • edited Sep 18, 2013 by zaph

User contributions licensed under CC BY-SA 3.0