New allocation profiler

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Apr 15 21:00:48 UTC 2015


On 04/15/2015 11:53 PM, Vladimir Sitnikov wrote:
> Got that.
> 
> Another question: is it really expected that if a single iteration
> returns NaN, then AVG aggregate become NaN as well?

Probably yes. NaN means both "absent" and "zero" result now. After we
are done with the mechanics to get proper "zero" results, NaN should
mean only "absent", and should aggregate to NaN.

So, the future-proof profiler code should produce NaN if something
really wrong happened (e.g. the tracing method thrown an exception, and
you can't be sure aggregate would be correct anyway), and produce "zero"
result otherwise.


> I wonder if "/ (afterTime - beforeTime)" should be guarded with !=0
> check or if we should allow it to fail so the iteration is marked as
> failed.

In most places that's a floating point division, and if by sheer luck
the time delta is zero, it will divide into infinity, already marking
the result as suspicious (but still closest to mathematically correct!) :)

Thanks,
-Aleksey




More information about the jmh-dev mailing list