mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2026-10-13 21:34:25 +00:00
[PR #152] feat: make PreallocatedBuffersPerPool configurable at runtime #170
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-go#170
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-go/pull/152
Author: @william-aqn
Created: 7/12/2026
Status: 🔄 Open
Base:
master← Head:configurable-buffer-pool📝 Commits (1)
f46f3d2feat: make PreallocatedBuffersPerPool configurable at runtime📊 Changes
5 files changed (+50 additions, -21 deletions)
View changed files
📝
README.md(+2 -0)📝
device/queueconstants_android.go(+9 -6)📝
device/queueconstants_default.go(+12 -6)📝
device/queueconstants_windows.go(+10 -6)📝
main.go(+17 -3)📄 Description
On memory-constrained hosts (consumer routers with 256-512 MB of RAM) the Linux default of PreallocatedBuffersPerPool = 0 lets the receive path allocate 64 KiB message buffers without bound whenever sustained inbound traffic outpaces the (software) crypto pipeline. Field case: an ASUS RT-AX82U (512 MB, armv7) running the standalone daemon dies with
fatal error: runtime: out of memorya few minutes into any sustained stream, allocation stack inRoutineReceiveIncoming -> GetMessageBuffer -> WaitPool.Get. Rebuilding with the pool bounded at 1024 (the value the ios profile already ships) fixes it: WaitPool.Get blocks the receiver when the pool is full, the kernel drops excess UDP, and peers treat that as ordinary congestion.
Make the bound adjustable without patching the source:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.