Skip to content

Conversation

@dannykopping
Copy link
Contributor

@dannykopping dannykopping commented Dec 12, 2025

All credit for this fix goes to Opus 4.5 ❤️

I identified a problem this morning; we thought the reason for tests were using up to 25GiB of RAM due to excessive postgres databases being created after we moved away from dbmem. As it turns out, about half of the in-use heap is caused by Wireguard device buffers.

image

coder/wireguard-go#4 is a vibed solution to this problem whereby the buffers are tuned way down when a build tag is used. Disclaimer: I have no idea what impact this has as I haven't looked into this very carefully yet, BUT the tests all pass so 🤷.

Uncached: DONE 13293 tests, 51 skipped in 162.041s and uses about 4GiB of RAM
Cached: DONE 13293 tests, 51 skipped in 7.712s and uses about 1GiB of RAM

The RAM usage observations were purely just eyeballing using top and comparing against the baseline; confounding factors abound, but it's much better than it was at least. Needs validation.

Signed-off-by: Danny Kopping <danny@coder.com>
Signed-off-by: Danny Kopping <danny@coder.com>
Copy link
Contributor

@DevelopmentCats DevelopmentCats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Code Review

Reviewed memory optimization changes across test infrastructure.

Found 1 issue (1 important).


AI review via Coder Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants