Closed
Description
When sending moderate amounts of ReconnectingPTY traffic to coderd, we observe high memory usage that eventually is released once the load drops.
This is the result of sending approximately 4MiB/s of ReconnectingPTY traffic to coderd (4096 kB @ 10Hz).
We see memory usage rise up to approx 5GiB and then drop off after the traffic subsides.
A pprof sample taken at 15:36 (indicated by the blue line) shows a high proportion of memory usage by device.PopulatePools:
github.com/tailscale/wireguard-go/device.(*WaitPool).Get
/home/runner/go/pkg/mod/github.com/tailscale/wireguard-go@v0.0.0-20221219190806-4fa124729667/device/pools.go
Total: 0 3.92GB (flat, cum) 97.76%
36 . 3.92GB ???
Pprof available here: