mem_ios.go 589 B

123456789101112131415161718192021
  1. // Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package wgengine
  5. import (
  6. "github.com/tailscale/wireguard-go/device"
  7. )
  8. // iOS has a very restrictive memory limit on network extensions.
  9. // Reduce the maximum amount of memory that wireguard-go can allocate
  10. // to avoid getting killed.
  11. func init() {
  12. device.QueueStagedSize = 64
  13. device.QueueOutboundSize = 64
  14. device.QueueInboundSize = 64
  15. device.QueueHandshakeSize = 64
  16. device.PreallocatedBuffersPerPool = 64
  17. }