1

I am currently showing that my app is using a maximum of 200MB when it is running. Is there a way to tell if this is going to trigger a low memory warning? So far I have not had any issues with the simulator or actuall devices.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Frameone
  • 33
  • 5
  • Possible duplicate of [ios app maximum memory budget](https://stackoverflow.com/questions/5887248/ios-app-maximum-memory-budget) – Max von Hippel Jul 08 '17 at 00:02
  • This is likely a duplicate of [this question](https://stackoverflow.com/q/5887248/1586231). However, that (linked) question is definitely out of date - the iOS devices increase significantly in memory every generation. Therefore I suggest you try some of the tests from that answer on contemporary devices in order to find a more up-to-date answer. – Max von Hippel Jul 08 '17 at 00:03

1 Answers1

1

We must avoid spiking the memory. For example loading images from disk or cache in loop. This will create a memory spike and it is at this point iOS starts to throw low memory warnings. The exact amount of memory is not specified by Apple. In many applications I have observed that as the memory grows gradually iOS is comfortable and app works properly. But if memory spike occurs low memory warning is thrown.

Apps can use 200 MB of memory these days easily, how ever it is important to simulate and handle low memory warnings in order to be on the safe side.

If you want to trigger low memory warning using simulator, there is a option of doing so in the Menu->Debug of Simulator (Cmd+Shift+M). In device you may load some big images in a for loop. You may also call a private method. [[UIApplication sharedApplication] performSelector:@selector(_performMemoryWarning)]; Just be sure that this code does not go to production as Apple will reject the binary as private method is being used.