当我打开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)
谢谢, 迪内希
答案 0 :(得分:1)
我必须按照http://code.google.com/p/caliper/issues/detail?id=114&sort=-id中的提法定义ALLOCATION_JAR。已经在CentOS-6和Mac OSX 10.7.2中进行了测试
答案 1 :(得分:0)
2个问题,一个是maven依赖带来一个破坏的allocation.jar,另一个是(正如其他答案所提到的)你需要定义ALLOCATION_JAR环境变量。尝试并按照此post将其设置为Ant构建的一部分,看看它是否有帮助。