De-doubled call tree with profiler

Romain Quinio romain.quinio at gmail.com
Mon Mar 6 14:57:45 UTC 2017


Hi,

I've noticed using Java Mission Control profiler that for some JMH
benchmarks the call tree was "de-doubled", i.e. my benchmark method (here
mypackage.generated.MyBenchmark_decodeXmlToJaxb_jmhTest.decodeXmlToJaxb)
appears twice, here with a ratio of 60%/40%:

java.lang.Thread.run()
   java.util.concurrent.ThreadPoolExecutor$Worker.run()

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)
         java.util.concurrent.FutureTask.run()
            java.util.concurrent.Executors$RunnableAdapter.call()
               java.util.concurrent.FutureTask.run()

org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call()

org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call()
                        java.lang.reflect.Method.invoke(Object, Object[])

sun.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[])

sun.reflect.GeneratedMethodAccessor7.invoke(Object, Object[])

*mypackage.generated.MyBenchmark_decodeXmlToJaxb_jmhTest.decodeXmlToJaxb_AverageTime(InfraControl,
ThreadParams)*

sun.reflect.NativeMethodAccessorImpl.invoke(Object, Object[])

sun.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])


*mypackage.generated.MyBenchmark_decodeXmlToJaxb_jmhTest.decodeXmlToJaxb_AverageTime(InfraControl,
ThreadParams)*
My benchmark settings are:
@Fork(value = 1, jvmArgsAppend = { "-XX:+UnlockCommercialFeatures",
"-XX:+FlightRecorder",

"-XX:StartFlightRecording=duration=60s,filename=./profiling-decodeXmlToJaxb.jfr,name=profile,settings=profile",

"-XX:FlightRecorderOptions=settings=D:/Java/jdk1.7.0_85/jre/lib/jfr/profile.jfc,samplethreads=true"
})
@Benchmark
@Warmup(iterations = 15, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 20, time = 1, timeUnit = TimeUnit.SECONDS)
@State(Scope.Thread)
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)

I'm curious to know what could be causing this !

Thanks,
Romain


More information about the jmh-dev mailing list