Tuesday, December 21, 2010

Data Formatters temporarily unavailable, will re-try after a continue

Mysterious crash happens, when I'm trying to display about 65MB image in iPhone4. Wonder what could be the problem... (hint: trying to display 65 MEGABYTE image file):
Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")

First error usually means that system killed your application, because it was using too much memory. This is not always the case, but right now I can't recall any other reasons. If you got few "Received memory warning. Level=1" messages just beforehands, the case is clear: out of memory.


Please note that running out of memory does not necessarily mean there is memory leak(s). It means that whatever you're doing is simply using more memory than what is available.

Second error means that debugger couldn't load "Data Formatters" to show any more meaningful error messages. Debugger got confused most likely, because your application was using way too much memory.

How to fix this problem? Not so easy, especially if you did not get any "memory warning" messages. You are doing something BIG, which simply consumes all available, and then some more, memory of the device. Usually you could release some memory in didReceiveMemoryWarning routines, but this time none was called.

Review your code, review your algorithm, review your path of execution. See if you could split up something into smaller pieces. Try using lower resolutions. Try scaling down. Check, if some autorelease variable could be handled manually. Check, if you could use your own NSAutoReleasePool inside some tight loop.

Not going to be easy.

2 comments:

  1. You shouldn't load a 65MB image for display. Check out the PhotoScroller demo project which demonstrates handling of high resolution images.

    ReplyDelete
  2. That example is based on local image file, which is split into small pieces in advance.

    My image comes from network and if I want to split it, so that I could show it on-screen, I got to open it first for splitting. Catch-22 :)

    ReplyDelete