Caliper:如果我使用measureMemory参数运行,则出现ConfigurationException
当我打开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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须按照 http:// 中提到的方式定义 ALLOCATION_JAR code.google.com/p/caliper/issues/detail?id=114&sort=-id。已在 CentOS-6 和 Mac OSX 10.7.2 中测试过
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
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.