mem_ios.go 500 B

1234567891011121314151617181920
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. package wgengine
  4. import (
  5. "github.com/tailscale/wireguard-go/device"
  6. )
  7. // iOS has a very restrictive memory limit on network extensions.
  8. // Reduce the maximum amount of memory that wireguard-go can allocate
  9. // to avoid getting killed.
  10. func init() {
  11. device.QueueStagedSize = 64
  12. device.QueueOutboundSize = 64
  13. device.QueueInboundSize = 64
  14. device.QueueHandshakeSize = 64
  15. device.PreallocatedBuffersPerPool = 64
  16. }