ARC 下的内存问题(应用因小泄漏和 2MB 分配而崩溃)
因此,我正在尝试将我的第一个应用程序准备好提交到应用程序商店,并且我正处于其分析/分析阶段。我的应用程序崩溃了,我有一些问题似乎无法找到答案。
我一直通过 Instruments 运行我的应用程序检查分配和泄漏,并且它经常崩溃。奇怪的是,分配显示我的总数只有 2-3MB,虽然我确实有泄漏,但仪器仅偶尔显示约 300 字节(大约每 2-3 分钟一次,大量使用),但我仍然得到崩溃时出现低内存错误和 signal:9 Killed:9 。
是否有分配未向我显示的内容? (即情节提要初始化的视图,或在后台线程上分配的内存)
我的小泄漏问题有多严重?显然我正在努力消除它,但这有可能只是转移注意力吗?或者这可能是我崩溃的原因吗?
So I'm trying to get my first app ready to submit to the app store, and I'm at the profiling/analysis stage of it. My app is crashing, and I have some questions I can't seem to dig up answers to.
I've been running my app through Instruments checking allocations and leaks, and it's been crashing fairly regularly. The weird part is that allocations says my total is only 2-3MB, and while I do have a leak, Instruments shows only an occasional ~300 bytes (about once every 2-3 minutes with heavy use), but I'm still getting low memory errors and signal:9 killed:9 when it crashes.
Are there things that Allocations isn't showing me? (i.e. storyboard initialized views, or memory allocated on background threads)
How significant a problem is my small leak? I'm obviously working to stamp it out, but is it likely that this is just a red herring? Or could it be the cause of my crashes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我做了一些HeapShot 分析(归功于 bbum 的精彩演练),发现了两个实例,实际上我正在泄漏内存,只是在泄漏仪器没有捕获到这一点。
经过几天的测试,应用程序运行稳定,所以现在看起来没问题。
I did some HeapShot analysis (credit goes to bbum for the awesome walkthrough) and found two instances where I WAS in fact leaking memory, just in a way that wasn't being captured by the Leaks instrument.
App's been running steadily through a few more days of testing, so it seems alright now.