英文:
Application freezing on g1 old run
问题
我们目前运行DonutSMP.net,这是一个Minecraft服务器,每天在线同时处理超过4000名玩家,运行的是生存游戏模式,占用大量服务器资源。目前我们遇到了一些G1 OLD问题,每次G1 OLD运行时服务器都会冻结,主要原因是我们要尽量避免G1 OLD运行,因为它实际上是一个不便宜的过程。有没有办法调查是什么原因导致它运行,而且不只是一次,而是连续发生。
以下是所有应用程序的启动标志,我们运行大约30个Minecraft服务器,似乎它们都有相同的问题。
-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
我已经获得了最大内存使用时刻的堆转储文件,只是不太清楚应该寻找什么。
我已经尝试分析堆转储文件,但似乎没有明显的内存泄漏,实例目前并没有崩溃。我已经尝试通过降低视野距离等方式减少内存使用,但到目前为止一些方法并没有奏效。我还尝试更改启动标志参数,但如果它们是原因的话,我还没有找到合适的值。我期望G1 OLD不再运行,因为每次运行时服务器都会冻结,这些实例大约有90名玩家在生存模式下游玩,所有参数都经过了调整,不应该出现这个问题。
英文:
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.
答案1
得分: 1
以下是翻译好的部分:
如果是我的话,我会摒弃所有这些选项:
-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
然后告诉 G1GC 想要达到的暂停时间,并让它自行调整。
特别是那些设置新空间大小或比例的选项将覆盖 G1GC 的自动调整,该调整旨在满足您指定的暂停时间目标。新空间的收集是停止一切的,因此对大型新空间的收集将不可避免地导致长时间的暂停。
获取更多建议,请阅读:
- 垃圾优先垃圾收集器调优 由 Monica Beckwith
- 10 - 垃圾优先垃圾收集器调优
英文:
If it was me, I would get rid of all of these options:
-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
Then tell the G1GC what pause time to aim for, and let it work things out for itself.
In particular, the options that set sizes or ratios for the new space will override G1GC's self-tuning that is intended to meet your specified pause time goals. The new space collection is stop-the-world, so a collection of a large new space is going to inevitably lead to long pauses.
For more advice, read:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论