Retrogen runs the server out of memory
Baughn opened this issue ยท 0 comments
I used /forge generate
to pregenerate a mid-sized (~7500x7500 blocks) world.
This didn't generate RC structures, so I attempted to use /#retro
to fix it. Possibly that could have worked -- however, what actually happened was the server attempting to go through the entire map in a single tick. Apart from locking up the server (and potentially making the Forge watchdog fire, crashing it), this also ended up running it out of memory.
Presumably the cause was chunks never being unloaded, since that doesn't happen in the middle of ticks. While throttling to keep reasonable TPS would be valuable in general, a simple fix for this specific problem would be to track the total number of loaded chunks and pause retrogen if it exceeds some multiple of what it is at the start.
(A fixed value would be problematic, as some long-running games can end up with a lot of loaded chunks. The best logic might be something like max(1000, 2*(chunks loaded at start of retrogen))
.)