Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App Extension's maximum memory budget

According to Apple's App Extension Programming Guide:

Memory limits for running app extensions are significantly lower than the memory limits imposed on a foreground app. On both platforms, the system may aggressively terminate extensions because users want to return to their main goal in the host app. Some extensions may have lower memory limits than others: For example, widgets must be especially efficient because users are likely to have several widgets open at the same time.

App Extension has a very strict memory Constraint, and vary from each other.

What's the maximum memory budget for each type of App Extension?
Can I test them like iOS App ios app maximum memory budget?

like image 469
wj2061 Avatar asked May 21 '16 09:05

wj2061


People also ask

How much memory is too much for iOS app?

16GB of RAM is the highest amount of RAM ever offered in an iPhone or iPad, and the 5GB limitation means that apps aren't able to utilize even half of what the iPad Pro has to offer.

How do I reduce the RAM usage on my iPhone?

Open the Settings app and select "General." Tap "Storage & iCloud Usage" and then tap "Manage Storage" in the Storage section. Tap the Music app in the list of apps. Swipe any artist or specific songs from right to left and then tap "Delete." You can also swipe "All Songs" to delete all of your music at once.

What is memory usage iPhone?

Go to Settings > General > [Device] Storage. You might see a list of recommendations for optimizing your device's storage, followed by a list of installed apps and the amount of storage each one uses. Tap an app's name for more information about its storage. Cached data and temporary data might not be counted as usage.

Is there a maximum file size I can download on iOS?

I think you've answered your own question: try not to go beyond the 70 Mb limit, however it really depends on many things: what iOS version you're using (not SDK), how many applications running in background, what exact memory you're using etc.

How to reduce the memory usage of an iOS app?

Just avoid the instant memory splashes (e.g. you're using 40 Mb of RAM, and then allocating 80 Mb's more for some short computation). In this case iOS would kill your application immediately. You should also consider lazy loading of assets (load them only when you really need and not beforehand).

Which device has the most memory constraints?

Memory wise, Ipod Touch 4th gen seems to be the most constraint device for us since it has the same amount of RAM (256 compared to Iphone 4's 512) as 3gs but we're using HD assets on it. The app used to crash when trying to load 100-110mb of ram but now that we're down to 70MB, we've never had loading crash.

What is the maximum amount of memory a device can use?

Based on Split's and Jasper Pol's answer, using a maximum of 45% of the total device memory appears to be a safe threshold (thanks guys). Swift (based on this answer ):


1 Answers

I just encounter on iPad Pro 9.7 a crash with message:

Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=120 MB, unused=0x0)

So it is 120 MB on a 2GB iOS device, but note that, limit differs based on type of extension.

Example:

Apple confirmed the 5-6MB memory limit for network extensions, raised to 15MB since iOS 10 Beta 2. These limits are insufficient for some Apps (see Psiphon3 ticket).

Testing a VPN (Network Extension's NEPacketTunnelProvider) produced below error:

Thread 1: EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=15 MB, unused=0x0)
like image 136
Owen Zhao Avatar answered Oct 06 '22 00:10

Owen Zhao