简体   繁体   中英

iPhone game is crashing after memory warning with message “ Data Formatters temporarily unavailable, will re-try after a 'continue' ”

I am in the final stage of developing an iPhone game and I am dealing with a crash that appears to be memory related.

It happens only on the device when I load a game level several times (10 to 15 times). I get some memory warnings around the 8th time and if I keep loading the same level it finally crashes with this message on the console:

Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library  
"/Developer/usr/lib/libXcodeDebuggerSupport.dylib")

Some goolge search told me this message usually means the app has run out of memory.

I ran the app under instruments but it didn't detect any memory leaks and the total allocation remained around 1,5Mb (both live and overall bytes) reaching 5,4Mb for a fraction of a second everytime I loaded a level. This doesn't seem a lot since a leaky test app didn't crash before allocating more than 30Mb on the same device (iPhone 3GS). I am new to instruments so maybe I am missing something.

I ve been struggling with this bug for days now and I would be really thankful if someone could point me in the right direction.

Yes, your searching was right " this message usually means the app has run out of memory " Please read memory management documentation from apple and release your objects properly if where you getting memory leaks.It will reducing memory warnings as well as your code will work fine. When you allocating simultaneously objects when new level loading it will indirectly premises you allocating objects but you not able to delloc properly, it means that you creating new memory for new object but still old object is in memory. After this scenario why not you got memory warning?

Check in Instruments the Activity Monitor instrument. You'll find the correct amount of RAM you are consuming at any given time. The Allocations instrument is not really an indicator of RAM usage. It will however help in finding things that have been allocated and not released. Use heapshots in Allocations to find out where things are being leaked.

http://www.friday.com/bbum/2010/10/17/when-is-a-leak-not-a-leak-using-heapshot-analysis-to-find-undesirable-memory-growth/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM