tersesystems/blindsight

use prof gc to show the gc allocation rates

wsargent opened this issue · 0 comments

It looks like there's a gc.alloc.rate, but you have to use -prof gc for it.

https://shipilev.net/blog/2016/arrays-wisdom-ancients/ has an example.

But, in our case, we can take a shortcut and estimate the allocation pressure directly. For that, JMH has the -prof gc profiler, that listens for GC events, adds them up, and normalizes the allocation/churn rates to the number of benchmark ops, giving you the allocation pressure per @benchmark call.

https://github.com/Valloric/jmh-playground/blob/master/src/jmh/java/org/openjdk/jmh/samples/JMHSample_35_Profilers.java#L126

Also see prof stack.

https://github.com/plokhotnyuk/jsoniter-scala/blame/master/README.md#L373

sbt 'jsoniter-scala-benchmarkJVM/jmh:run -prof gc -rf json -rff jdk8.json .*Reading.*'