9 Replies
      Latest reply on Jun 10, 2018 7:36 PM by eskimo
      Cougnes Level 1 Level 1 (10 points)

        I've been wondering what is the memory limit for network extensions. Specifically, I'm using the NEPacketTunnelProvider extension point.


        The various posts on this forum mention 5 MB and 6 MB for 32-bit and 64-bit respectively. However I find that (at least on iOS 10) the upper limit seems to be 15 MB. Is this the new memory limit for extensions?

        • Re: What is the memory limit for a network extension?
          eskimo Apple Staff Apple Staff (9,685 points)

          You’re right that the limit for packet tunnel providers has been raised.  However, other providers still have really low limits.  Here’s what I’m seeing currently.


          Provider32-bit64-bit
          packet tunnel14 MiB15 MiB
          app proxy14 MiB15 MiB
          filter control5 MiB6 MiB
          filter data5 MiB6 MiB

          IMPORTANT These limits have changed in the past and may well change in the future.  I’m posting them to assist in your debugging.  You should not hard code knowledge about these limits into your code.  The only way to ensure that your provider can run within the system’s memory limits is to thoroughly test it on a wide range of device / OS combinations.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: What is the memory limit for a network extension?
              steelhead Level 1 Level 1 (0 points)

              thanks Quinn,

               

              our delivery of using the filter extensions would go from server based to local smart device if the 5/6 mb limits would be raised to 14/15. this would be an absolute game changer for us and change our entire focus and delivery

                • Re: What is the memory limit for a network extension?
                  eskimo Apple Staff Apple Staff (9,685 points)

                  our delivery of using the filter extensions would go from server based to local smart device if the 5/6 mb limits would be raised to 14/15. this would be an absolute game changer for us and change our entire focus and delivery

                  Fair enough.  If you want to get this feedback in front of folks who have the ability to actually change things, I recommend you file an enhancement request with the details.  Please post your bug number, just for the record.


                  On a technical note, have you looked at using memory mapped files?  It seems to me that content filters are likely to have a large amount of data that’s read a lot and only written too infrequently.  That’s a good match for memory mapping, and memory mapping can radically change the memory management game.

                  Share and Enjoy

                  Quinn “The Eskimo!”
                  Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                  let myEmail = "eskimo" + "1" + "@apple.com"

                    • Re: What is the memory limit for a network extension?
                      steelhead Level 1 Level 1 (0 points)

                      bug number 31223449

                       

                       

                      as always quinn, a pleasure talking with you

                        • Re: What is the memory limit for a network extension?
                          eskimo Apple Staff Apple Staff (9,685 points)

                          I had cause to look at the iOS 11 numbers today and I figured I might as well post an update here (for the benefit of Future Quinn™ if no one else).


                          Provider64-bit
                          packet tunnel15 MiB
                          app proxy15 MiB
                          filter control6 MiB
                          filter data12 MiB
                          DNS proxy15 MiB

                          The big change here is the increased headroom on the filter control provider.  It looks like steelhead’s bug report got some traction (r. 31223449).

                          IMPORTANT These limits have changed in the past and may well change in the future.  I’m posting them to assist in your debugging.  You should not hard code knowledge about these limits into your code.  The only way to ensure that your provider can run within the system’s memory limits is to thoroughly test it on a wide range of device / OS combinations.

                          Share and Enjoy

                          Quinn “The Eskimo!”
                          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
                          let myEmail = "eskimo" + "1" + "@apple.com"

                    • Re: What is the memory limit for a network extension?
                      AmitShkaya Level 1 Level 1 (0 points)

                      Hi Eskimo,


                      I have implemented NEPacketTunnelProvider and VPN is connected successfuly in iOS,  But when i am launching container app agiain as soon as i get call on


                      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions function of container app, the extension process terminated. and i can't get the status of VPN that should be in connected state.
    
                               I want to continue with the same process that was started earlier. Is there any way to acheive this.


                      
 

                      Thanks,

                      Amit