Debugging excess memory and leaks in system extensions

System extensions on iOS have very low limits on allowed memory. For instance the DNS proxy extensions seem to be limited to 15MB. When I try to monitor the extension with instruments it quickly runs out of memory, most likely due to the way instruments tracks memory usage.

I did find that there are two entitlements related to memory usage but it is unclear if these would work for extensions or only for applications.

What are the best techniques for debugging extensions that run out of memory?

Is there a way to temporarily increase the limit while debugging?

Answered by DTS Engineer in 810598022
System extensions on iOS

Technically these are app extensions. That matters because on macOS you can package an NE provider as a system extension. See TN3134 Network Extension provider deployment.

I did find that there are two entitlements related to memory usage but it is unclear if these would work for extensions or only for applications.

I’m presuming you’re talking about the entitlements I discuss here. If so, you are correct that these aren’t relevant to app extensions.

Is there a way to temporarily increase the limit while debugging?

No.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer
System extensions on iOS

Technically these are app extensions. That matters because on macOS you can package an NE provider as a system extension. See TN3134 Network Extension provider deployment.

I did find that there are two entitlements related to memory usage but it is unclear if these would work for extensions or only for applications.

I’m presuming you’re talking about the entitlements I discuss here. If so, you are correct that these aren’t relevant to app extensions.

Is there a way to temporarily increase the limit while debugging?

No.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Debugging excess memory and leaks in system extensions
 
 
Q