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

StackOverflow https://stackoverflow.com/questions/7255080

  •  17-01-2021
  •  | 
  •  

Вопрос

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

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top