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.
所以这个故事,苹果最近拒绝了我的应用程序,说它在手机上崩溃了(iPhone 3G和ipod touch 2g),并发给我两个崩溃日志。我从中可以理解其中的任何一个。
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.
他们说即使重启后也没有区别。继承人,它在我的iPhone 3GS上完美运行,在模拟器中没有内存泄漏。
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
在模拟器中登录[会话开始于2010-01-16 20:01:44 +1300。] GNU gdb 6.3.50-20050815(Apple版本gdb-1346)(2009年9月18日星期五20:40:51)版权所有2004 Free Software Foundation,Inc。GDB是GNU通用公共许可证所涵盖的免费软件,欢迎您在特定条件下更改和/或分发它。输入“show copying”查看条件。 GDB完全没有保修。输入“show warranty”了解详情。此GDB配置为“x86_64-apple-darwin”.sharedlibrary apply-load-rules all附加到进程1152. dyld:无法加载插入的库:/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)
数据格式化程序暂时不可用,将在“继续”后重新尝试。 (目前无法调用加载程序,它被锁定。)警告:找不到“_sigtramp”的最小符号 - 回溯可能不可靠无法访问地址0x0处的内存无法访问地址0x0处的内存(gdb)
5 个解决方案
#1
5
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).
如果您使用多页视图控制器,请尝试这个简单的测试 - 使用ObjectAlloc仪器运行您的应用程序。点击某个东西来显示一个子视图,你应该看到你的内存增加 - 现在忽略该视图并返回主视图,内存应该下降。如果没有,那就是你的问题(或者其中一个问题,但这是一个可能的起点)。
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.
要尝试跟踪此情况,请在每个视图控制器的dealloc中放置断点,并查看实际调用的内容。对于未按预期发布的视图控制器,在ObjectAlloc中,您可以看到每个保留对象的发布位置,并确定在不应该保留对象时保留对象的内容。
In general the ObjectAlloc flow should look like a graph that goes up and down all the time, not constantly rising.
通常,ObjectAlloc流应该看起来像一个一直上下的图形,而不是不断上升。
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.
另外,购买旧款Touch进行测试。
#2
5
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.
请参阅“免费页面:309”?不好,意味着你正在使用一堆内存然后当它全部使用它崩溃。可清除页面= 0是无法回收的内存,因此它是内存问题。
Do a "Build and Analyze" and run "Leaks" to find memory leaks and places you can run more efficiently.
执行“构建和分析”并运行“泄漏”以查找内存泄漏和可以更有效地运行的位置。
#3
3
Your app used too much memory. Check your app with Instruments (Object Allocations or Leaks) and see if you can reduce memory allocation.
您的应用使用了太多内存。使用Instruments(对象分配或泄漏)检查您的应用程序,看看是否可以减少内存分配。
#4
3
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.
您的iPhone 3GS和模拟器的内存远远超过其他iPhone OS设备。要在所有设备上工作,您应该使用不超过20 MB的内存。
#5
2
You app is using way, way too much memory. It'll never run on older devices with 128 MB of RAM.
你的应用程序是使用方式,太多的内存。它永远不会在具有128 MB RAM的旧设备上运行。
#1
5
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).
如果您使用多页视图控制器,请尝试这个简单的测试 - 使用ObjectAlloc仪器运行您的应用程序。点击某个东西来显示一个子视图,你应该看到你的内存增加 - 现在忽略该视图并返回主视图,内存应该下降。如果没有,那就是你的问题(或者其中一个问题,但这是一个可能的起点)。
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.
要尝试跟踪此情况,请在每个视图控制器的dealloc中放置断点,并查看实际调用的内容。对于未按预期发布的视图控制器,在ObjectAlloc中,您可以看到每个保留对象的发布位置,并确定在不应该保留对象时保留对象的内容。
In general the ObjectAlloc flow should look like a graph that goes up and down all the time, not constantly rising.
通常,ObjectAlloc流应该看起来像一个一直上下的图形,而不是不断上升。
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.
另外,购买旧款Touch进行测试。
#2
5
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.
请参阅“免费页面:309”?不好,意味着你正在使用一堆内存然后当它全部使用它崩溃。可清除页面= 0是无法回收的内存,因此它是内存问题。
Do a "Build and Analyze" and run "Leaks" to find memory leaks and places you can run more efficiently.
执行“构建和分析”并运行“泄漏”以查找内存泄漏和可以更有效地运行的位置。
#3
3
Your app used too much memory. Check your app with Instruments (Object Allocations or Leaks) and see if you can reduce memory allocation.
您的应用使用了太多内存。使用Instruments(对象分配或泄漏)检查您的应用程序,看看是否可以减少内存分配。
#4
3
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.
您的iPhone 3GS和模拟器的内存远远超过其他iPhone OS设备。要在所有设备上工作,您应该使用不超过20 MB的内存。
#5
2
You app is using way, way too much memory. It'll never run on older devices with 128 MB of RAM.
你的应用程序是使用方式,太多的内存。它永远不会在具有128 MB RAM的旧设备上运行。