question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized VM option 'UseShenandoahGC'

See original GitHub issue

Environment:

  • Jib version: 2.6.0
  • Build tool: Gradle 6.7
  • OS: Win10 or MacOS

Description of the issue: The base image for java 11 (“gcr.io/distroless/java:11”) doesn’t support ShenandoahGC.

Expected behavior: The application runs correctly on the created JVM.

Steps to reproduce:

  1. Setup a gradle build;
  2. Build it;
  3. Run it.

jib-gradle-plugin Configuration:

jib {
  from {
    image = DockerProps.BASE_IMAGE
  }
  container {
    jvmFlags = parseSpaceSeparatedArgs("-noverify -XX:+UseShenandoahGC -Xss${JVMProps.XSS} -Xmx${JVMProps.XMX} -Xms${JVMProps.XMS} -XX:MaxMetaspaceSize=${JVMProps.MAX_METASPACE_SIZE} -XX:MaxDirectMemorySize=${JVMProps.MAX_DIRECT_MEMORY_SIZE} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${JVMProps.HEAPDUMP_PATH} -Dspring.profiles.active=dev")
    ports = listOf(DockerProps.APP_PORT)
    labels = mapOf("app-name" to application.applicationName, "service-version" to version.toString())
  }
}

// DockerProps.BASE_IMAGE = "gcr.io/distroless/java:11"

Log output: Unrecognized VM option ‘UseShenandoahGC’ Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chanseokohcommented, Oct 29, 2020

Thanks for the reference. The link says

JDK 11 | … | In mainline OpenJDK 11u builds since 11.0.9.

The version of the OpenJDK 11 build by Debian in gcr.io/distroless/java:11 is currently 11.0.6. Actually, the image is based on the Debian 9 oldstable, where Debian does not usually provide updates to packages. You may want to use the Debian 10-based gcr.io/distroless/java-debian10:11. Note that gcr.io/distroless/java-debian10:11 was using 11.0.8 until now, and the 11.0.9 Distroless image was published today, so make sure to rebuild your image online to use 11.0.9. Looks like the OpenJDK 11.0.9 Debian build does accept -XX:+UseShenandoahGC.

0reactions
chanseokohcommented, Oct 29, 2020

Your previous link lists some builds:

Releases

Known sources for Shenandoah-enabled OpenJDK:

  • OpenJDK 12+ builds normally include Shenandoah by default; some vendors (notably Oracle) choose to exclude it
  • Fedora 24+ OpenJDK 8+ builds include Shenandoah
  • RHEL 7.4+ ships with OpenJDK 8+ that includes Shenandoah as Technology Preview
  • RHEL/Fedora-based distros or other distros that use packages from them may also have Shenandoah enabled. Notably, CentOS, Oracle Linux, and Amazon Linux are known to ship it.
  • Gentoo ebuilds for IcedTea have Shenandoah USE flag
  • Red Hat OpenJDK 8u builds for Windows include Shenandoah
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unrecognized VM option 'UseShenandoahGC' in java-11 ...
Describe the bug Encountered Unrecognized VM option 'UseShenandoahGC' when passing the flag -XX:+UseShenandoahGC In ...
Read more >
Unrecognized VM option 'ShenandoahGCHeuristics=compact'
Unrecognized VM option 'ShenandoahGCHeuristics=compact' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred.
Read more >
Unrecognized JVM GC options when using JAVA 11
Unrecognized VM option 'UseGCLogFileRotation' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred.
Read more >
[JDK-8250888] nsk/jvmti/scenarios/general_functions/GF08 ...
I.e. in jdk11u the option UseShenandoahGC is not even available if the VM has not been built without Shenandoah. Such a VM prints...
Read more >
1308539 – Shenandoah 1.0 - Red Hat Bugzilla
... OpenJDK 64-Bit Server VM (build 25.77-b03, mixed mode) [omajid@localhost ~]$ java -XX:+UseShenandoahGC -version Unrecognized VM option ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found