Small issues with JMH + JOL on JDK-9

Attila-Mihaly Balazs dify.ltd at gmail.com
Thu Mar 31 09:16:57 UTC 2016


Hello,

JMH fails on JDK 9-ea, VM 9-ea+110 with the exception:

Exception in thread "main" java.util.ServiceConfigurationError:
sun.management.spi.PlatformMBeanProvider: Provider
jdk.management.cmm.internal.PlatformMBeanProviderImpl not found
    at java.util.ServiceLoader.fail(ServiceLoader.java:237)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:183)
    at
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:402)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:478)
    at java.lang.Iterable.forEach(Iterable.java:74)
    at
java.lang.management.ManagementFactory$PlatformMBeanFinder.lambda$static$0(ManagementFactory.java:890)
    at java.security.AccessController.doPrivileged(Native Method)
    at
java.security.AccessController.doPrivileged(AccessController.java:428)
    at
java.lang.management.ManagementFactory$PlatformMBeanFinder.<clinit>(ManagementFactory.java:886)
    at
java.lang.management.ManagementFactory.getPlatformMXBean(ManagementFactory.java:649)
    at
java.lang.management.ManagementFactory.getRuntimeMXBean(ManagementFactory.java:355)
    at org.openjdk.jmh.runner.Runner.newBenchmarkParams(Runner.java:473)
    at org.openjdk.jmh.runner.Runner.getActionPlans(Runner.java:356)
    at org.openjdk.jmh.runner.Runner.runBenchmarks(Runner.java:529)
    at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:313)
    at org.openjdk.jmh.runner.Runner.run(Runner.java:206)
    at org.openjdk.jmh.Main.main(Main.java:71)

(However it works as expected with JDK 9-ea, VM 9-ea+111 - so this is just
a heads up / FYI that there might be the need of an additional unit /
integration test in OpenJDK).

Also, since ea+111 JOL logs the following thing:

WARNING: Couldn't find PID of current JVM process.
WARNING: VM details, e.g. object alignment, reference size, compressed
references info will be guessed.

This warning doesn't appear with ea+109 or JDK 1.8.77 by default. However
I'm able to generate an other warning from JOL on both JVMs by specifying
-XX:ObjectAlignmentInBytes=32 or higher:

WARNING: Unable to attach Serviceability Agent even with super-user
privileges: Attaching as HotSpot SA to current process (id=19352) from
external process failed
WARNING: VM details, e.g. object alignment, reference size, compressed
references info will be guessed.

Cheers,
Attila


More information about the jmh-dev mailing list