Memory used by any iPhone app

后端 未结 2 1122

There are a few things that I don\'t understand about iOS memory management.

  1. I wanted to know how much memory typically an iPhone app takes while running on

相关标签:
2条回答
  • 2021-01-03 04:35

    Q1) There isn't a fixed value, of course. Every application (and application instance) will use a different amount of memory depending on it's task(s). There is a maximum, however. Reaching this maximum will trigger a memory warning and the OS may kill it.

    Q2) Images: Depends on how many you are showing at once, or through animations.

    Q3) The application in the foreground gets the most memory allocated to it. Applications in the background can request memory to perform background tasks.

    Good article for best practices:

    http://inessential.com/2010/06/28/how_i_manage_memory

    0 讨论(0)
  • 2021-01-03 04:44

    There isn't a stated or fixed amount of memory available to apps on iOS devices.

    That said, there are game apps that are reported to use over 55MB of memory, however the OS is also reported to kill these games some significant percentage of the time if not run right after a device reset.

    If you use 22MB of memory or less, the OS could still kill your app because there wasn't enough available memory, but it would also have to kill a massive percentage of other apps in the app store, so you would be in very good company.

    When any app (foreground or background) requests enough memory to start depleting the memory pool sufficiently, memory warnings are sent to other apps. If the memory pool gets small enough, apps are killed, including possibly the foreground app if it's a big memory hog.

    0 讨论(0)
提交回复
热议问题