Panel: JVM arguments

Created on 1 Jun 2019  路  12Comments  路  Source: pterodactyl/panel

Background (please complete the following information):

  • Panel or Daemon: Daemon
  • Version of Panel/Daemon: 0.7.13
  • Server's OS: 0.6.12
  • Your Computer's OS & Browser: Modified chromium os & chrome

Describe the bug
Linux leapmc.net 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u2 (2019-05-13) x86_64 GNU/Linux
https://paste.helpch.at/yesuyenise.makefile

I was testing pterodactyl on a testing machine when i noticed it didnt support more advanced JVM arguments.

To Reproduce
Steps to reproduce the behavior:

  1. Make a server(Bukkit, Spigot or Paper)
  2. change its JVM arguments to: java -Xms128M -Xmx{{SERVER_MEMORY}}M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar {{SERVER_JARFILE}}
  3. startup your server
  4. enjoy your errors: /entrypoint.sh: line 15: 23 Killed java -Xms128M -Xmx1024M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+AlwaysPreTouch -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar server.jar

Expected behavior
To work with the more advanced JVM arguments. This even works with pufferpanel and a simple script.

All 12 comments

The issue here is this flag - -XX:+AlwaysPreTouch

It tries to allocate the entire amount of ram and that is the issue. It causes the server to out of memory.

Ohh and thats why it worked on other systems, because they didnt use docker?

I removed that flag but still getting
/entrypoint.sh: line 15: 23 Killed java -Xms128M -Xmx1024M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar server.jar
[Pterodactyl Daemon] Server marked as OFF
[Pterodactyl Daemon] ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon] Exit Code: 137
[Pterodactyl Daemon] Out of Memory: true
[Pterodactyl Daemon] Error Response:
[Pterodactyl Daemon] Server process detected as entering a crashed state; rebooting.

Current flags: java -Xms128M -Xmx{{SERVER_MEMORY}}M -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:G1MixedGCLiveThresholdPercent=35 -XX:+ParallelRefProcEnabled -Dusing.aikars.flags=mcflags.emc.gs -jar {{SERVER_JARFILE}}

Did it rebuild after changing the startup? It should have.

I know that is the recommended flags from the spigot team but honestly I don't see the benefit of using them all.

The paper egg has some extra flags but I don't see the improvement to make them necessary.

@PixelNotFound try removing -Xmx{{SERVER_MEMORY}} and manually defining an amount that leaves about 500MB of overhead compared to the amount of memory you have set in the panel for the server.

The OOM killer is a bit... heavy handed... which can lead to some of these issues.

Did it rebuild after changing the startup? It should have.I know that is the recommended flags from the spigot team but honestly I don't see the benefit of using them all.The paper egg has some extra flags but I don't see the improvement to make them necessary.

For better GC.

@DaneEveritt So when i got 1024,i should change it to 524?

Can you quantitatively prove it get's better GC?

I got this JVM thing from https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/

And everything i read from aikar so far has been true. So I am confident it is

I know about their docs, and I have already told them we aren't changing things to work with their specific JVM flags.

I mean we might be able to play around with some settings, but overall its going to happen regardless with Docker containers I believe just because of the resource limits. Its a pretty common thing if you Google around. I'm also not sure if those flags still all apply when running in a containerized environment.

Technically the JVM now has better support for detecting docker environments, so maybe we can look into getting that better implemented with our things. That requires Java 10 though.

Alright thanks for the information!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

msharp19 picture msharp19  路  4Comments

x390 picture x390  路  4Comments

stijnb1234 picture stijnb1234  路  3Comments

DaneEveritt picture DaneEveritt  路  4Comments

WeatherSquad picture WeatherSquad  路  3Comments