简体   繁体   English

如何降低内存使用率和应用程序大小(iPhone)?

[英]How do keep memory usage and size of application down (iPhone)?

I am currently working on a personal iPhone project that is very audio and graphic-intense and I have therefore been quite conscious of how much of a footprint my application has (in terms of both memory usage while active and/or in 'multi-tasking mode' and how much the size of application is) as Apple sub-consciously gets into my mind and has drilled in the fact the iPhone has limited memory and capacity - and I was curious if any of you guys had any solutions that could help me keep down the usage of my application - I've open up Instruments and configured some aspects although this primarily appeals to me as a performance utility). 我目前正在从事一个非常有音频和图形强度的个人iPhone项目,因此我非常意识到我的应用程序有多少占用空间(就活动时的内存使用情况和/或“多任务处理”而言)模式”以及应用程序的大小),因为苹果下意识地进入了我的脑海,并深入了解了iPhone的内存和容量有限的事实-我很好奇你们中是否有人有任何可以帮助我的解决方案降低应用程序的使用率-我已经打开了Instruments并配置了一些方面,尽管这主要是作为性能实用程序吸引我的)。 I have also been testing on my device as I cannot stand the simulator... 我也正在设备上进行测试,因为我无法忍受模拟器。

As long as you are properly releasing objects that aren't being used, you should be fine. 只要您正确释放不使用的对象,就可以了。 If you are loading large images and audio files, then your app will require more memory to handle those, so alloc/release those as they are needed. 如果要加载较大的图像和音频文件,则您的应用将需要更多的内存来处理它们,因此请根据需要分配/释放它们。

Also, debugging memory issues on the Simulator just wont work, so don't rely on it for testing memory issues. 另外,在模拟器上调试内存问题将无法正常工作,因此请勿依赖它来测试内存问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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