Caliper:如果我使用measureMemory参数运行,则出现ConfigurationException

发布于 2024-12-26 20:11:03 字数 3144 浏览 1 评论 0原文

当我打开measureMemory参数时,我收到ConfigurationException(代理库失败) 在来自 Caliper 源的 Tutorial.java 中(http://code.google.com/p/caliper/source/browse/#svn%2Ftrunk%2Ftutorial)

不知道我错过了什么。我在本地构建了卡尺罐。如果没有这个参数,一切都会很好。我想看看我的操作消耗了多少内存

bash-3.2$ java -javaagent:/Users/ndchandar/CCRC/libs/allocation.jar -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes com.google.caliper.Runner com.mycompany.perf.Tutorial.Benchmark1 -Dlength=1,10 --measureMemory
 0% Scenario{vm=java, trial=0, benchmark=NanoTime}json  in read method of InterleavedReader => {"measurements":[{"raw":55.240640625951315,"processed":55.240640625951315,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}},{"raw":54.34121282152953,"processed":54.34121282152953,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}},{"raw":54.94355677030953,"processed":54.94355677030953,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}}],"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000},"systemOutCharCount":0,"systemErrCharCount":0}
  Failed to execute java -javaagent:null -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes:/Users/ndchandar/CCRC/libs/allocation.jar com.google.caliper.InProcessRunner --warmupMillis 3000 --runMillis 1000 --measurementType INSTANCE --marker //ZxJ/ -Dbenchmark=NanoTime com.mycompany.perf.Tutorial.Benchmark1
Error opening zip file or JAR manifest missing : null
Error occurred during initialization of VM
agent library failed to init: instrument

An exception was thrown from the benchmark code.
com.google.caliper.ConfigurationException: Failed to execute java -javaagent:null -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes:/Users/ndchandar/CCRC/libs/allocation.jar com.google.caliper.InProcessRunner --warmupMillis 3000 --runMillis 1000 --measurementType INSTANCE --marker //ZxJ/ -Dbenchmark=NanoTime com.mycompany.perf.Tutorial.Benchmark1
    at com.google.caliper.Runner.measure(Runner.java:310)
    at com.google.caliper.Runner.runScenario(Runner.java:236)
    at com.google.caliper.Runner.runOutOfProcess(Runner.java:379)
    at com.google.caliper.Runner.run(Runner.java:98)
    at com.google.caliper.Runner.main(Runner.java:424)

谢谢, 迪内什

I am getting ConfigurationException(agent library failed) when I turn on measureMemory parameter
in Tutorial.java from Caliper source (http://code.google.com/p/caliper/source/browse/#svn%2Ftrunk%2Ftutorial)

Not sure what I am missing. I have built caliper jar locally. Without this parameter everything works great. I would like to see how memory my operation consumes

bash-3.2$ java -javaagent:/Users/ndchandar/CCRC/libs/allocation.jar -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes com.google.caliper.Runner com.mycompany.perf.Tutorial.Benchmark1 -Dlength=1,10 --measureMemory
 0% Scenario{vm=java, trial=0, benchmark=NanoTime}json  in read method of InterleavedReader => {"measurements":[{"raw":55.240640625951315,"processed":55.240640625951315,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}},{"raw":54.34121282152953,"processed":54.34121282152953,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}},{"raw":54.94355677030953,"processed":54.94355677030953,"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000}}],"unitNames":{"ns":1,"s":1000000000,"ms":1000000,"us":1000},"systemOutCharCount":0,"systemErrCharCount":0}
  Failed to execute java -javaagent:null -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes:/Users/ndchandar/CCRC/libs/allocation.jar com.google.caliper.InProcessRunner --warmupMillis 3000 --runMillis 1000 --measurementType INSTANCE --marker //ZxJ/ -Dbenchmark=NanoTime com.mycompany.perf.Tutorial.Benchmark1
Error opening zip file or JAR manifest missing : null
Error occurred during initialization of VM
agent library failed to init: instrument

An exception was thrown from the benchmark code.
com.google.caliper.ConfigurationException: Failed to execute java -javaagent:null -cp /Users/ndchandar/CCRC/libs/guava-r09.jar:/Users/ndchandar/CCRC/libs/gson-2.1.jar:/Users/ndchandar/CCRC/libs/asm-3.3.jar:/Users/ndchandar/CCRC/libs/asm-analysis-3.3.jar:/Users/ndchandar/CCRC/libs/allocation.jar:/Users/ndchandar/CCRC/libs/jsr305.jar:/Users/ndchandar/CCRC/libs/jarjar-1.0rc8.jar:/Users/ndchandar/CCRC/libs/caliper-1.0-SNAPSHOT.jar:target/test-classes:/Users/ndchandar/CCRC/libs/allocation.jar com.google.caliper.InProcessRunner --warmupMillis 3000 --runMillis 1000 --measurementType INSTANCE --marker //ZxJ/ -Dbenchmark=NanoTime com.mycompany.perf.Tutorial.Benchmark1
    at com.google.caliper.Runner.measure(Runner.java:310)
    at com.google.caliper.Runner.runScenario(Runner.java:236)
    at com.google.caliper.Runner.runOutOfProcess(Runner.java:379)
    at com.google.caliper.Runner.run(Runner.java:98)
    at com.google.caliper.Runner.main(Runner.java:424)

Thanks,
Dinesh

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

吃不饱 2025-01-02 20:11:03

I had to define ALLOCATION_JAR as mentioned in http://code.google.com/p/caliper/issues/detail?id=114&sort=-id. Have tested this in CentOS-6 and Mac OSX 10.7.2

当爱已成负担 2025-01-02 20:11:03

2 个问题,一个是 Maven 依赖项带来了损坏的 Allocation.jar,另一个是(如其他答案所述)您需要定义 ALLOCATION_JAR 环境变量。尝试并按照此帖子 将其设置为 Ant 构建的一部分,看看是否有帮助。

2 issues, one is the maven dependency brings in a broken allocation.jar, the other is(as mentioned by other answer) you need to define the ALLOCATION_JAR environment variable. Try and follow this post to set it up as part of an Ant build, see if it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文