开发者

Shrinking iPhone Memory?

开发者 https://www.devze.com 2022-12-17 06:48 出处:网络
I have noticed in my application that didReceiveMemoryWarning gets called much faster if my phone has not been powered开发者_如何转开发 down for a long time. It almost seems like the pool of memory th

I have noticed in my application that didReceiveMemoryWarning gets called much faster if my phone has not been powered开发者_如何转开发 down for a long time. It almost seems like the pool of memory that my application can access shrinks with time.

Has anyone else noticed this and is there an explanation for it? Is there a course of action that I can take to keep this from happening?

I notice this happening when I use a good chunk of memory taking and manipulating a picture. Powering down and rebooting the phone helps out. Is it possible that the memory that my application can access is shrinking or maybe the existing memory is fragmented and rebooting defrags the existing memory?

Any explanation or help with this issue would be great. Thanks.


Yes, this is, unfortunately, well known behavior. As the OS runs, cruft develops, and a restart is eventually required to clear things out. This is why many apps in the appstore request a restart before playing their game.


Older versions of the iPod daemon, mediaserverd, used to leak.

That resulted in the behaviour you describe.

If one system service can leak, so can others.


Just because we don't get to multitask our apps doesn't mean the iPhone is doing multitasking.

Open web pages in Safari stay in memory until the OS sends Safari the same memory warning you're getting. Mail might start working while your app is running and require more memory. the iPod app is also keeping quite a bit of memory for itself.

If you look at the console of the iPhone using the Organizer while your app getting a low memory warning you'll probably see some of the built in apps also getting memory warning and terminating things to free memory. It's quite interesting.

0

精彩评论

暂无评论...
验证码 换一张
取 消