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

Unrecognized VM option 'CMSIncrementalPacing' causes failure to start #370

Open
InsomniacSoftware opened this issue Nov 21, 2018 · 3 comments

Comments

@InsomniacSoftware
Copy link

The default java invocation uses unrecognized (CMSIncrementalPacing) and deprecated (UseConcMarkSweepGC) VM options under Java 10

From the /etc/msm.conf file

DEFAULT_INVOCATION="java -Xms{RAM}M -Xmx{RAM}M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -jar {JAR} nogui"

When trying to start the server, it would say Starting server... Done. but it doesn't actually start. Because java doesn't even start up, nothing is sent to the log file which made it very confusing on why it was failing.

When manually running the command, I am shown the actual error message

$ java -Xms2048M -Xmx2048M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -jar /opt/msm/servers/foo/server.jar nogui
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Unrecognized VM option 'CMSIncrementalPacing'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

This is on a fresh install of Ubuntu 18.04.1 Server with apt install default-jdk and apt install default-jre installing Java v10.0.2.

# java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.3, mixed mode)

When I ran the command again but without the -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing arguments, the server started up without issue.

Since Java 10 is now the default version, it is likely more people are going to encounter this issue.
Suggestions:

  1. Check the java version and if it is >9 then don't use these options.
  2. The as_user function should log a message if the su command fails
  3. The as_user function or the server_start function should capture stderr to the log when trying to start the server just in case there are problems like this.
@Kadah
Copy link
Contributor

Kadah commented Nov 30, 2018

Apparently "[t]he CMS collector is deprecated as of JDK 9" according to Oracle, so it might be better to check if Java version is 8 to use -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing.

Java 8_161 is still the minimum supported version for Minecraft, otherwise I'd suggest just removing the CMS related flags.

@nickovs
Copy link

nickovs commented Jan 21, 2019

See my comment in #374. You can fix this for the time being by editing /etc/msm.conf.

@nixjdm
Copy link

nixjdm commented Jun 10, 2019

On top of this, with version 11,

OpenJDK 64-Bit Server VM warning: Option AggressiveOpts was deprecated in version 11.0 and will likely be removed in a future release.

That leaves us with just the normal

DEFAULT_INVOCATION="java -Xms{RAM}M -Xmx{RAM}M -jar {JAR} nogui"

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

4 participants