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

不知道我在想什么。我在本地建造了卡尺罐。没有此参数,一切都很好。我想看看我的操作消耗了多少内存

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)


谢谢,
Dinesh

最佳答案

我必须定义http://code.google.com/p/caliper/issues/detail?id=114&sort=-id中提到的ALLOCATION_JAR。已在CentOS-6和Mac OSX 10.7.2中测试过

10-02 10:01