#Gc collection for next gen (Reduce lag spikes fps drops)

5 messages · Page 1 of 1 (latest)

sleek lava
#

Rust (the game) uses a garbage collector, and you can manage it via the console to reduce lag spikes and stuttering. (Both Pc and console use similar render pipelines HDRP)
Key Console Commands
gc.buffer [value]: This is the most critical command for performance. It sets the size of the memory buffer (in MB) before the game forces a garbage collection cycle.
Default: Typically 256.
Recommended: Set to 2048 if you have 16GB of RAM, or 4096 if you have 32GB or more. This reduces the frequency of "freezes" during gameplay.
gc.collect: Manually triggers a garbage collection cycle immediately. Many players use this while in a safe zone (like their base) to prevent the game from auto-collecting during a fight.
gc.unload: Frees up RAM by unloading assets that are no longer in use.
Why it Matters
The game is built on the Unity engine, which uses a C sharp garbage collector to manage memory. When this collector runs, it often causes a 1–2 second "stutter" or lag spike because it must briefly pause the game to identify and clear unused data. Increasing the buffer size allows the game to store more data before being forced to clear it, making these freezes much rarer.

desert crown
fading light
#

The game has it currently set to 32mb (maybe not i don't remember tbh) and the game only has around 1500mb of free memory and having less memory free tends to be a bad thing as when a big base loads in the game will crash due to a lack of free memory

sleek lava
#

Would be nice if they double check sometimes if they can squeeze more memory into gc buffer it would solve a lot of the “lag spikes” people often talk about both on console and Pc. Maybe they can find a way to get it to run better than the original pipeline method. And yeah that is an issue with the console limitations of the memory limits.

#

Xbox series x uses 16GB GDDR6 unified memory. Which acts as both ram and vram assuming why the memory error occurs because it’s pulling too much data. Only way to fix this would be to use a global rendering pipeline which reduces asset generation constantly reading (Pc tried this but could never get it implemented correctly because they didn’t want to focus on it) however it did stop high memory usage and base pop in, stutter in its early experimental stage.