iPhone 应用程序在内存警告事件发生前崩溃
应用程序因内存开销而崩溃,但 applicationDidReceiveMemoryWarning 事件未及时引发。 (我确切地知道崩溃的原因是内存不足,因为它在资源加载时崩溃并且没有相应的崩溃报告,并且XCode不会中断调试,应用程序默默地退出到跳板)。
所以我正在寻找一些方法来防止这种开销。也许有一个函数或工具可以提供可用内存量?
The app crashes because of memory overhead, but applicationDidReceiveMemoryWarning event doesn't raise in time. (I know exactly that the reason of crash is low memory because it crashes on resources loading and there is no corresponding crash report, and XCode doesn't break debugging, app silently quits to springboard).
So I'm looking for some method how to prevent this overhead. Maybe there is a function or instrument that gives amount of available memory?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在仪器(分配)中运行它并捕获前后堆的快照。
Run it in instruments (allocations) and capture a shot of the heap before and after.
罗伯特·哈维链接中的答案:
The answer in link by Robert Harvey: