by shubla » Tue Nov 02, 2021 7:20 pm
Well its obviously just Javas GC doing its work. You could try using different configs for GC. The old GC's in java <11(?) etc. are not supposed to be used for real-time applications such as games (or even g1 to be honest). For game you would want at most 16ms stops in the gc, and for audio buffering even less than that. But with old gc it may take more than 50ms or even hundreds easily sometimes causing that annoying stutter.
GC1 works for most people, but with ZGC you can get even better performance. No micro stutters at all, they aim for sub millisecond pause times. Sadly, at least an year ago there were some bugs with it in hnh. Sometimes the heap usage went to 95% not really going down, and thus fps dropped to 1 or even less. Only way to fix was to either force manual gc few times (yes its weird) or restart the game.
Could be that its fixed on newer versions though, as ZGC is under very active development from what I've presumed.
Fun fact is that the door sound in HnH is really not supposed to sound like what you often hear. Lots of objects are allocated and freed when you exit/enter a world and thus gc does lots of work and pausing causing the sound to go weird as audio buffer gets choppy.
Sadly I think HnH does not work with the newest java versions. There are lots of improvements to gc which is one of main issues people have with the game so I hope it will some day work with java 17 etc.
Edit: Also using fancy ram may have minor improvements, I'd imagine.