1

我正在尝试运行 jcstress 0.5,但出现错误:

Error: VM option 'StressLCM' is develop and is available only in debug version of VM.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

完整日志:

Probing what VM modes are available:
 (failures are non-fatal, but may miss some interesting cases)

----- [OK] [-Xint]
----- [OK] [-XX:TieredStopAtLevel=1]
----- [OK] []
----- [N/A] [-XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM]
Error: VM option 'StressLCM' is develop and is available only in debug version of VM.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


----- [OK] [-XX:-TieredCompilation]
----- [N/A] [-XX:-TieredCompilation, -XX:+UnlockDiagnosticVMOptions, -XX:+StressLCM, -XX:+StressGCM]
Error: VM option 'StressLCM' is develop and is available only in debug version of VM.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.



Initializing and probing the target VM: 
 (all failures are non-fatal, but may affect testing accuracy)

----- [OK] Unlocking diagnostic VM options
Burning up to figure out the exact CPU count....... done!

----- [OK] Trimming down the default VM heap size to 1/8-th of max RAM
----- [OK] Trimming down the number of compiler threads
----- [OK] Trimming down the number of parallel GC threads
----- [OK] Trimming down the number of concurrent GC threads
----- [OK] Trimming down the number of G1 concurrent refinement GC threads
----- [OK] Testing @Contended works on all results and infra objects
----- [OK] Unlocking Whitebox API for online de-optimization
----- [OK] Testing allocation profiling
----- [FAILED] Trying Thread.onSpinWait
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.Thread.onSpinWait()V
    at org.openjdk.jcstress.vm.ThreadSpinWaitTestMain.main(ThreadSpinWaitTestMain.java:30)


  Hardware threads in use/available: 8/8, no yielding.
  Test preset mode: "default"
  Writing the test results to "jcstress-results-2019-02-05-22-08-52.bin.gz"
  Parsing results to "results/"
  Running each test matching ".*" for 1 forks, 5 iterations, 1000 ms each
  Each JVM would execute at most 5 tests in the row.
  Solo stride size will be autobalanced within [10, 10000] elements, but taking no more than 100 Mb.

Exception in thread "main" java.lang.NullPointerException
    at java.io.Reader.<init>(Reader.java:78)
    at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
    at org.openjdk.jcstress.infra.runners.TestList.getTests(TestList.java:53)
    at org.openjdk.jcstress.infra.runners.TestList.tests(TestList.java:105)
    at org.openjdk.jcstress.JCStress.getTests(JCStress.java:139)
    at org.openjdk.jcstress.JCStress.run(JCStress.java:67)
    at org.openjdk.jcstress.Main.main(Main.java:60)

我用来运行测试的命令:

java -cp jars/jcstress-core-0.5.jar:jars/jopt-simple-4.6.jar org.openjdk.jcstress.Main
4

2 回答 2

1

当您尝试 JDK 16/17 等最新版本时,它应该可以正常工作。

于 2021-10-14T06:24:00.200 回答
0

您没有说您使用的是哪个版本的 Java。但是对于我来说,同样的事情发生在 Oracle 构建的 Windows JDK-8 上。不过,JDK-12 似乎还不错。此外,您可以尝试其中一种:https ://builds.shipilev.net/ 。

于 2019-04-23T06:51:13.210 回答