iPhone:其他应用程序占用内存的漏洞?
【腾讯云】亏本大甩卖,服务器4核16G 1年370元(带宽12M,系统盘120GB SSD盘,月流量2000GB)!!!!!!
云产品 配置 价格
服务器 1核2G,带宽5M,系统盘50GB SSD盘,月流量500GB 38元/年
MySQL 1核1G 19元/年
服务器 16核32G,带宽18M,系统盘250GB SSD盘,月流量5000GB 1197元/年
点我进入腾讯云,查看更多详情

I'm reading some people stating that if another (3rd party) app on someone's iPhone has been leaking memory, that this may reduce the (mystery) amount of RAM your app would otherwise have available.

This confuses me -- does not all app memory get released when the app is closed by the user? And only one app is open at a time on iPhone?

#0

Normally, any memory that your application allocates will be freed when it exits. However, many of Apple's applications continue running after they're "closed", so memory leaks in Mail, for instance, can affect available memory.

In addition, there are apps out there that claim to free up allocated memory. They really don't do anything other than force some dirty pages out of the buffer cache, but they appear to do something, so people believe they must be doing something useful.

#1

You should run Instruments and then add the instrument "Memory Monitor" to see the memory use of all of the other processes on your phone. (Add with Window -> Library , then drag the Memory Monitor instrument to the instrument panel.

What I'm still trying to determine is why is iOS releasing memory from MY app, and not all of the other memory pig apps that are not currently running.

#2

On a jailbroken phone - yes, third party apps can be running at the same time as yours. Running out of memory is common with people who like to have many apps running at once hence the need for task managers, killing tasks etc.

On an unhacked phone - no. Yours is the only non-apple app that is running, no others can run at the same time.

So what can you do? All you can do is try to use the minimum memory possible which you're probably already doing. Realistically you can only test with a factory, unhacked phone, unless you are going to spend hours trying to please everyone. If you think you are maybe using too much you could identify the larger allocations using the instruments tools ("Run with performance tool >" from within Xcode) and then post that chunk of code here to get ideas of how to reduce it.

推荐文章

将单个值赋给多个变量

将单个值赋给多个变量

推荐文章

查看照片的Facebook权限

查看照片的Facebook权限

推荐文章

中止AJAX发布

中止AJAX发布

推荐文章

RowDataBound事件中标题文本更改时的Gridview排序

RowDataBound事件中标题文本更改时的Gridview排序

推荐文章

fork()调用

fork()调用

推荐文章

如何通过Django控制Apache连接到mongoose(另一个HTTP服务器)?

如何通过Django控制Apache连接到mongoose(另一个HTTP服务器)?

推荐文章

没有驾驶员,AirPrint如何工作?

没有驾驶员,AirPrint如何工作?

推荐文章

Android传感器管理器中的getSensorList()与getDefaultSensor()比较

Android传感器管理器中的getSensorList()与getDefaultSensor()比较

推荐文章

64位Windows 7上的RailsInstaller?

64位Windows 7上的RailsInstaller?

推荐文章

wp电子商务从哪里加载插件主题文件?

wp电子商务从哪里加载插件主题文件?

推荐文章

paypal集成asp.net4

paypal集成asp.net4

推荐文章

如何在Zend框架中执行查询

如何在Zend框架中执行查询

推荐文章

空白页jquery.SPServices服务列出了一个sharepoint列表

空白页jquery.SPServices服务列出了一个sharepoint列表

推荐文章

Singleton类中“release”实现中返回类型的分布式对象修饰符冲突

Singleton类中“release”实现中返回类型的分布式对象修饰符冲突

推荐文章

带可选参数的Web服务方法

带可选参数的Web服务方法

推荐文章

用水豚进行硒平行试验

用水豚进行硒平行试验