如何解决早期开始但是由于内存压力而终止的应用程序现在? [英] How can I address an app that started earlier, but is "Terminated due to Memory Pressure" now?

查看:133
本文介绍了如何解决早期开始但是由于内存压力而终止的应用程序现在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Xcode中的iOS应用程序上工作。早些时候,我开始运行,达到了有限的功能。那么有编译失败,声称没有改变的样板生成代码有语法错误。将源代码复制到新项目中会有一个不同的问题。



现在,我可以编译并开始运行,但是在发布映像显示之前,由于内存压力,应用程序关闭。总体视觉资产约为272M,可以优化一些,而不会损害图形丰富度,而且到目前为止,该计划的唯一领域预计将会很大。 (资产可能会被保存在内存中;例如,每个当前的加载映像都会被填充,而我的代码从未以编程方式访问任何加载的映像。)它在加载映像本身加载之前崩溃。



如何解决这个内存问题?我可以减少图像处理的方式,但我怀疑有另一个根本原因。还是这个过多的记忆消耗?



谢谢,

解决方案

性能调整部分。使用Apple的 Instruments 应用程序来确定如何,何时以及如何您应用程序使用的内存太多。



您应该考虑的一种方法是将图形资源与应用程序断开连接,一旦您感觉到它们就会逐个添加回来满足iOS的要求和限制。



现在,这部分我的答案是意见:听起来你的应用程序是高风险的从App Store被拒绝,万一这是您这个应用程序的目的地。


I am working on an iOS app in Xcode. Earlier I got it to start and run, up to a limited level of functionality. Then there were compilation failures claiming untouched boilerplate generated code had syntax errors. Copying the source code into a new project gets a different problem.

Right now, I can compile and start running, but it states before even the launch image shows up that the application was closed due to memory pressure. The total visual assets is around 272M, which could be optimized some without hurting graphical richness, and is so far the only area of the program expected to be large. (The assets may or may not be kept in memory; for instance every current loading image is populated and my code never accesses any loading image programmatically.) And it crashes before the loading image has itself loaded.

How can I address this memory issue? I may be able to slim down the way images are handled, but I suspect there is another root cause. Or is this excessive memory consumption?

Thanks,

解决方案

Review the Performance Tuning section of Apple's iOS Programming documentation. Use Apple's Instruments application to determine how, when, and how much memory your app is using.

One approach you should consider is to disconnect the graphics resources from your application, and add them back one-by-one once you feel they meet the requirements and limitations of iOS.

Now, this part of my answer is opinion: it sounds like your app is a high risk for being rejected from the App Store, in case that is your intended destination for this app.

这篇关于如何解决早期开始但是由于内存压力而终止的应用程序现在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆