Allocations profiler

Ben Manes ben_manes at yahoo.com
Thu Feb 19 19:23:13 UTC 2015


It would nice if the benchmark results included the average number of allocations that occurred per execution. This would probably be best done using a JMH profiler and can be implemented using a Java agent like Jeremy Manson's java-allocation-instrumenter. This basic usage could be extended to include a breakdown of the count and type of objects allocated, which could be useful to identity unintended allocations. A profiler like YourKit helps in this regard, but much coarser and harder to compare when benchmarking to chose between implementation techniques.
Go's benchcmp tool includes the allocation count in its results and a recent blog post showed how it was a useful metric when performance optimizing a library.


More information about the jmh-dev mailing list