caliper error: CICompilerCount of 1 is invalid; must be at least 2
caliper error: CICompilerCount of 1 is invalid; must be at least 2
我有一个卡尺基准 (1.0-beta-2):
import com.google.caliper.Benchmark;
import com.google.caliper.runner.CaliperMain;
public class MyBenchmark {
@Benchmark public int a(int rep) {
return 0;
}
public static void main(String[] args) {
CaliperMain.main(MyBenchmark.class, args);
}
}
i 运行 它来自 eclipse 或来自命令行:
mvn exec:java -Dexec.mainClass="com.google.caliper.runner.CaliperMain" -Dexec.args="MyBenchmark"
在这两种情况下我都遇到了错误:
ERROR: Trial failed to complete (its results will not be included in the run):
The worker exited without producing data. It has likely crashed. Inspect /tmp/1427055470061-0/trial-1.log to see any worker output.
在这个文件中我看到:
Trial Number: 1
Trial Id: d663a0b5-55b4-43c3-97d8-93f14f436342
Experiment: {instrument=allocation, benchmarkMethod=a, vm=default, parameters={}}
[stderr] CICompilerCount of 1 is invalid; must be at least 2
[stderr] Error: Could not create the Java Virtual Machine.
[stderr] Error: A fatal exception has occurred. Program will exit.
ubuntu14.04,java:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
有什么解决办法吗?
这是 Caliper 中的错误。它使用 -XX:CICompilerCount=1
作为默认的 JVM 参数。但是,当启用分层编译时,必须至少有 2 个编译器线程(一个用于 C1,一个用于 C2)。
尝试用更大的值手动覆盖 -XX:CICompilerCount
。
我找到了解决办法。 flag -XX:-TieredCompilation
有帮助。它可以直接在微基准测试中使用 java class as:
import com.google.caliper.api.VmOptions;
@VmOptions("-XX:-TieredCompilation")
public class MyMicrobenchmark {
...
我有一个卡尺基准 (1.0-beta-2):
import com.google.caliper.Benchmark;
import com.google.caliper.runner.CaliperMain;
public class MyBenchmark {
@Benchmark public int a(int rep) {
return 0;
}
public static void main(String[] args) {
CaliperMain.main(MyBenchmark.class, args);
}
}
i 运行 它来自 eclipse 或来自命令行:
mvn exec:java -Dexec.mainClass="com.google.caliper.runner.CaliperMain" -Dexec.args="MyBenchmark"
在这两种情况下我都遇到了错误:
ERROR: Trial failed to complete (its results will not be included in the run):
The worker exited without producing data. It has likely crashed. Inspect /tmp/1427055470061-0/trial-1.log to see any worker output.
在这个文件中我看到:
Trial Number: 1
Trial Id: d663a0b5-55b4-43c3-97d8-93f14f436342
Experiment: {instrument=allocation, benchmarkMethod=a, vm=default, parameters={}}
[stderr] CICompilerCount of 1 is invalid; must be at least 2
[stderr] Error: Could not create the Java Virtual Machine.
[stderr] Error: A fatal exception has occurred. Program will exit.
ubuntu14.04,java:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
有什么解决办法吗?
这是 Caliper 中的错误。它使用 -XX:CICompilerCount=1
作为默认的 JVM 参数。但是,当启用分层编译时,必须至少有 2 个编译器线程(一个用于 C1,一个用于 C2)。
尝试用更大的值手动覆盖 -XX:CICompilerCount
。
我找到了解决办法。 flag -XX:-TieredCompilation
有帮助。它可以直接在微基准测试中使用 java class as:
import com.google.caliper.api.VmOptions;
@VmOptions("-XX:-TieredCompilation")
public class MyMicrobenchmark {
...