fake call to applicationDidReceiveMemoryWarning being triggered even if I have around 80 MB of RAM left

二次信任 提交于 2019-12-11 22:49:47

问题


I have NSLog-ed the remaining memory in a timer repeating after 1 second. It just print the remaining memory.

The runtime requirement app is around 20 MB max. Log shows free memory 90 MB+ when I launch the app.

There is a tabBar in which one of the Tabs is having a Google Mapkit's Map. Once the application comes in working state, RAM - 80 MB.

When I scroll through the zoomed map- BOOM!!! "applicationDidReceiveMemoryWarning" logger still shows free memory counter around 75-80 MB.

This is causing my other views data to be released.

Anyways..even if the RAM is available and when app doesn't crash.. panning in Map drastically reduce the RAM to 3-4 MBs from 70-80 MB. With this case, if app claims for memory - lets say for a captured image - BOOM Again!!! "applicationDidReceiveMemoryWarning"

Anyone have experienced this before...?? any helpful comments..?

if you've not experienced this - just try it out with Apple's weather map sample app or the Native Maps Application on ur phone!! - to see how map eats up runtime memory when we pan a zoomed map...!!

Regards,

SamFisher


回答1:


That's how it's supposed to work. Memory is there to be used. Any that is not used is being wasted. As long as you have no memory leaks and you're unloading/reloading your views and caches correctly, there is no problem here.



来源:https://stackoverflow.com/questions/7255080/fake-call-to-applicationdidreceivememorywarning-being-triggered-even-if-i-have-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!