use prof gc to show the gc allocation rates
wsargent opened this issue · 0 comments
wsargent commented
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.
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.*'