java g1旧运行上的应用程序冻结

dbf7pr2w  于 2023-02-28  发布在  Java
关注(0)|答案(1)|浏览(111)

we currently run DonutSMP.net, a minecraft server that handles concurrently more than 4000 players online every day and it runs a survival gamemode, chunk-intensive, currently we have been experiencing some G1 OLD issues, every time the g1 old runs the server freezes, and mainly we would avoid the G1 old running since its not a cheap process at all. Is there anything I can do to investigate what would be causing it to run, not only once but its consitent.
Here is the startup flags of all the applications, we run about 30 mc boxes & all of them seem to be having the same issue.
-Xms16G -Xmx16G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 --add-modules=jdk.incubator.vector -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true
I have heap dumps of the most intensive memory usage moments, I just dont know exactly what to be looking for.
I already tried analyzing the heapdump but there doesnt seem to be a memory leak that's visible fast, the instances arent really crashing for now. Ive already tried reducing memory usage by lowering the view distance etc, so far some things havent worked. I have also tried to change hte startup flag parameters, but if they are the cause, i havent achieved the good values one yet. I am expecting the G1 old not to run because every time it does the server freezes, these instances run about 90 players survival and everything is really tunnned tweaked, it shouldnt be happening.

bsxbgnwa

bsxbgnwa1#

如果是我,我会放弃所有这些选择:

-XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 
-XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 
-XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 
-XX:InitiatingHeapOccupancyPercent=20
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=5 
-XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1

然后,告诉G1 GC什么样的暂停时间为目标,让它自己解决问题。
特别是,为新空间设置大小或比率的选项将覆盖G1 GC的自调优以满足暂停时间目标,新空间收集是stop-the-world,因此一个大的新空间将不可避免地导致长时间的暂停。
如需更多建议,请阅读:

相关问题