Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JVM arguments #1601

Closed
ghost opened this issue Jun 1, 2019 · 12 comments
Closed

JVM arguments #1601

ghost opened this issue Jun 1, 2019 · 12 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2019

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.

@parkervcp
Copy link
Member

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.

@ghost
Copy link
Author

ghost commented Jun 1, 2019

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

@ghost
Copy link
Author

ghost commented Jun 1, 2019

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.

@ghost
Copy link
Author

ghost commented Jun 1, 2019

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}}

@parkervcp
Copy link
Member

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.

@DaneEveritt
Copy link
Member

@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.

@ghost
Copy link
Author

ghost commented Jun 2, 2019

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?

@parkervcp
Copy link
Member

Can you quantitatively prove it get's better GC?

@ghost
Copy link
Author

ghost commented Jun 3, 2019

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

@parkervcp
Copy link
Member

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

@DaneEveritt
Copy link
Member

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.

@ghost
Copy link
Author

ghost commented Jun 3, 2019

Alright thanks for the information!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants