ValheimCommunityPatchGC
Garbage collector tuning for Valheim dedicated servers: a pre-grown mark stack against 'Unexpected mark stack overflow' crashes, plus optional collector settings. Companion to Valheim Community Patch.Changelog
1.0.0
- The server garbage collector settings from Valheim Community Patch 0.31.0, as their own plugin.
Reaching the collector's settings means reading and writing the Mono runtime's memory, which
malware scanners flag, so they moved out of the Community Patch, which removes them in 0.32.0.
- GC Mark Stack Target Entries (Linux), default 4194304 (64 MiB): grows the collector's mark stack
ahead of need, so a large heap is far less likely to abort the server with "Unexpected mark
stack overflow".
- GC Time Slice Milliseconds and GC Free Space Divisor default to 0, the game's own values:
production data showed the final pause of each collection grows with the heap (about 55 ms per
GB), not with the slice, and a lower divisor only makes pauses longer and rarer.
- On Linux the divisor is now applied at startup; in the Community Patch 0.31.0 it only took
effect after the next change to any garbage collector setting.
- The `vcp_gc` console command prints the collector's state and changes each setting live.
- Does nothing alongside Community Patch 0.31.x, which has its own copy of these settings.


