mark2devel / mark2

Minecraft Multi Server Wrapper Written in Python with Twisted; Pull Requests HIGHLY Encouraged, Collaborators Needed Discord: https://discord.gg/zymJygHNpv
Other
208 stars 44 forks source link

How so I set all these java flags? #92

Closed TomLewis closed 3 years ago

TomLewis commented 6 years ago

From https://aquifermc.org/threads/optimizing-paper-remove-lag-spikes-fix-tps-improve-performance.101/#post-822 I would like to use this tried and tested set of flags for Java, although im not sure how to set all of these in the mark2.properties

java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -Dusing.aikars.flags=mcflags.emc.gs -jar paperclip.jar

Trikolon commented 6 years ago

Like so:

java.cli.XX.AlwaysPreTouch=true
java.cli.XX.DisableExplicitGC=true
java.cli.XX.UseG1GC=true
#java.cli.XX.UnlockExperimentalVMOptions=true
java.cli.XX.MaxGCPauseMillis=45
java.cli.XX.TargetSurvivorRatio=90
#java.cli.XX.G1NewSizePercent=50
#java.cli.XX.G1MaxNewSizePercent=80
java.cli.XX.InitiatingHeapOccupancyPercent=10
#java.cli.XX.G1MixedGCLiveThresholdPercent=50
java.cli.XX.AggressiveOpts=true

However, there is an issue I came across while trying to use the experimental options (hence I had to disable them): Mark2 seems to re-arrange these flags and this causes the VM start to fail. I assume UnlockExperimentalVMOptions has to be provided before any of the G1 flags. Maybe @gsand can help out?

gsand commented 6 years ago

@Trikolon @FrozenBeard

# Insert your java arguments here
java.cli_extra=-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=100 -XX:+DisableExplicitGC -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts -XX:+AlwaysPreTouch -Dusing.aikars.flags=mcflags.emc.gs
TomLewis commented 6 years ago

@gsand Wait so I can just remove all the lines where its on its own line and put it all in one long list!? so comment out say java.cli.X.ms=8G?

Does this go where JVM options are?

https://pastebin.com/Y9zahJ0s

Trikolon commented 6 years ago

Thanks, works for me now.

@FrozenBeard Yes, just comment out / remove the "per line" flags and add them to java.cli_extra. Thanks for creating the issue, by the way. You reminded me of using the optimal flags. :)

Column01 commented 3 years ago

Closing this out to cleanup issues 😄