• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: debugging an iOS silent app crash on device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging an iOS silent app crash on device


  • Subject: Re: debugging an iOS silent app crash on device
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 28 Mar 2011 13:31:50 -0500

On 28 Mar 2011, at 9:59 AM, Jean-Denis Muys wrote:

- the crash happens when stepping over this code line: [self drawInRect:destRect]; where "self" is a UIImage
- the app display all go away, showing the springboard.
- the Xcode button is still enabled, suggesting that my app is still running.
- the debugger console doesn't report anything *at all*: no error, no exception, nothing
- the debug navigator is empty and only shows "Process Running"
- the pause/continue button is in its "continue" state (right pointing arrow), just as it was before stepping over. pressing it does nothing
- pressing my app icon on the device's multitasking bar restarts it from scratch.
- pressing Xcode's stop button seems to kill the app, but without any additional output in the debugger console

The code is from a small category I wrote on UIImage to draw thumbnails for images. It's quite straightforward and shown entirely below.

My suspicion is that this problem is memory related, as the image I am trying to scale down here is 6622x9361 pixels in a 6 MB JPEG file.

Um, yeah. That image would require about 248 million bytes to render in memory; JPEGs are compressed when they're files, but to work with them, they have to be rendered into big bad bitmaps. 248M is (to understate) a large chunk of the RAM on most devices.

If you run yourself out of memory, you will be evicted. No warning (if you do it all at once), no console message, you're dead. Apparently Xcode 4 doesn't catch up to the death of the process, and the debugging session has to be stopped manually.

You don't see it in the Simulator because the Simulator, and the apps it runs, are Mac OS X applications. They have access to many times the RAM your device has, backed with a swapping virtual memory system. You can't (unless you try) run a simulated app out of memory.

In the Device Organizer, select the "Device Logs" item for your test device. A crash log for your app will appear in the listing, but all it's going to tell you is that you ran out of memory. You know that.

Run your app under Instruments, with the Allocations template. Adjust the VM instrument to sample every second or so instead of manually. Run your app, and look particularly at the "dirty" memory, which is the actual burden on RAM. That will give you a clue to what's eating up memory.

But you already know: You're trying to fill a quarter-gigabyte of RAM on a non-swapping machine that doesn't have that much memory to spare.

— F

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: debugging an iOS silent app crash on device
      • From: Jean-Denis Muys <email@hidden>
References: 
 >debugging an iOS silent app crash on device (From: Jean-Denis Muys <email@hidden>)

  • Prev by Date: Re: So clicking on entries in the call stack doesn't take you to the source anymore?
  • Next by Date: CoreData Versioning in XCode4
  • Previous by thread: debugging an iOS silent app crash on device
  • Next by thread: Re: debugging an iOS silent app crash on device
  • Index(es):
    • Date
    • Thread