Z Garbage Collector (ZGC) causes a severe and frequent drop of framerate.
KrisCris opened this issue ยท 6 comments
Expected Behavior
Normal gameplay.
Actual Behavior
When I enabled ZGC as you recommended in the Readme, the whole game is unplayable... The framerate dropped below 10fps frequently, especially when I was moving fast (possibly loading chunks?).
Reproduction Steps
Add -XX:+UnlockExperimentalVMOptions -XX:+UseZGC
.
Attachments
No.
System Information
- System: Latest Windows 10
- Java Version: 14.0.2
- CPU: Intel core i7 7700HQ
- GPU: Nvidia GTX1060 [Notebook]
did you forget to remove the other dafault flags? like the -XX:+useG1G
(default garbage collector)
Minimum memory should equal maximum memory. Lag spikes could occur from the memory allocation increasing because it did not start with max memory. Also ZGC can fall behind and pause the main thread if it isn't given enough memory, so give it as much memory as you can.
Minimum memory should equal maximum memory. Lag spikes could occur from the memory allocation increasing because it did not start with max memory. Also ZGC can fall behind and pause the main thread if it isn't given enough memory, so give it as much memory as you can.
Hmm, nothing changed... Still extremely laggy, even in the main menu.
The advice to use ZGC was added when Sodium was developed against Minecraft 1.15. While generally speaking it provides for a smoother experience once everything has loaded in-game, later versions of the game have severely worsened startup performance due to the addition of new data-fixers that need to be built every time the game boots.
ZGC does not handle this extreme object allocation pressure very well on most systems, and it either needs tons of memory to be allocated or for many threads to be thrown at the problem. Neither is particularly great, but this is sort of an abusive edge case.