diff --git a/wireguard/device/queueconstants_default.go b/wireguard/device/queueconstants_default.go index f22fa33df..ae02b6387 100644 --- a/wireguard/device/queueconstants_default.go +++ b/wireguard/device/queueconstants_default.go @@ -15,5 +15,5 @@ const ( QueueInboundSize = 1024 QueueHandshakeSize = 1024 MaxSegmentSize = (1 << 16) - 1 // largest possible UDP datagram - PreallocatedBuffersPerPool = 0 // Disable and allow for infinite memory growth + PreallocatedBuffersPerPool = 4096 // Disable and allow for infinite memory growth ) diff --git a/wireguard/device/queueconstants_windows.go b/wireguard/device/queueconstants_windows.go index 1eee32ba1..3404afbf0 100644 --- a/wireguard/device/queueconstants_windows.go +++ b/wireguard/device/queueconstants_windows.go @@ -11,5 +11,5 @@ const ( QueueInboundSize = 1024 QueueHandshakeSize = 1024 MaxSegmentSize = 2048 - 32 // largest possible UDP datagram - PreallocatedBuffersPerPool = 0 // Disable and allow for infinite memory growth + PreallocatedBuffersPerPool = 4096 // Disable and allow for infinite memory growth )