JMH 使用选项生成器添加内存
JMH add memory using Options builder
我是 运行 JMH 基准:
Options opt = new OptionsBuilder()
.output("C:/test/infinispan/benchmarkThr" + THREAD_COUNT + ".txt")
.include(InfinispanFileStoreCreateUpdateGetBenchmark.class.getSimpleName())
.include(InfinispanMemoryCreateUpdateGetBenchmark.class.getSimpleName())
//.jvmArgsPrepend("-Xms1024m -Xmx1024m")
.warmupIterations(0)
.measurementIterations(INTERATIONS)
.timeUnit(TimeUnit.MILLISECONDS)
.mode(Mode.SingleShotTime)
.threads(THREAD_COUNT)
.forks(1)
.build();
new Runner(opt).run();
我收到 OutOfMemoryError。我想添加更多(注释掉的文本)但我得到一个对我来说似乎很奇怪的错误(这应该 IMO 工作):
# Run progress: 0,00% complete, ETA 00:16:40
# Fork: 1 of 1
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid initial heap size: -Xms1024M -Xmx1124M
如何添加内存成功?
使用 2 个单独提供每个参数 String
而不是下一个:
...
.jvmArgs("-Xms1024m", "-Xmx1024m")
...
我是 运行 JMH 基准:
Options opt = new OptionsBuilder()
.output("C:/test/infinispan/benchmarkThr" + THREAD_COUNT + ".txt")
.include(InfinispanFileStoreCreateUpdateGetBenchmark.class.getSimpleName())
.include(InfinispanMemoryCreateUpdateGetBenchmark.class.getSimpleName())
//.jvmArgsPrepend("-Xms1024m -Xmx1024m")
.warmupIterations(0)
.measurementIterations(INTERATIONS)
.timeUnit(TimeUnit.MILLISECONDS)
.mode(Mode.SingleShotTime)
.threads(THREAD_COUNT)
.forks(1)
.build();
new Runner(opt).run();
我收到 OutOfMemoryError。我想添加更多(注释掉的文本)但我得到一个对我来说似乎很奇怪的错误(这应该 IMO 工作):
# Run progress: 0,00% complete, ETA 00:16:40
# Fork: 1 of 1
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Invalid initial heap size: -Xms1024M -Xmx1124M
如何添加内存成功?
使用 2 个单独提供每个参数 String
而不是下一个:
...
.jvmArgs("-Xms1024m", "-Xmx1024m")
...