We are experiencing an issue where our iOS app’s network extension (acting as a VPN) is being unexpectedly terminated by the operating system. The termination appears identical to a user-initiated stop, as the extension receives the following call: NEProviderStopReasonUserInitiated.
The issue occurs sporadically but can happen 10–20 times per day on devices with less than 10% free storage.
On one affected device, opening the Camera app (or using the camera within another app like WhatsApp) consistently triggers the issue, making it easily reproducible.
Memory consumption does not seem to be the cause—the extension is stopped while using only ~10MB of memory, well below the 50MB limit.
We noticed a pattern related to swap usage:
• On affected devices, the “Swap Used” column shows very low values (a few MB).
• On unaffected devices, swap usage is significantly higher (hundreds of MB).
• This is the only clear difference we’ve observed.
The issue occurs across different device models and iOS versions (18.2.1 and 17.6.1). It also happens across different app builds (compiled with Xcode 15.x and Xcode 16.x).
We found a similar report on the Apple Developer Forums: 🔗 https://developer.apple.com/forums/thread/108149
Has anyone else encountered this behavior with Network Extensions? Could low swap usage or system resource constraints be a factor? Any suggestions for debugging or potential workarounds would be greatly appreciated.