New allocation profiler

Aleksey Shipilev aleksey.shipilev at oracle.com
Wed Apr 15 20:32:57 UTC 2015


On 04/15/2015 11:17 PM, Vladimir Sitnikov wrote:
>> $churn accumulates the results within the iteration
> 
> As far as I can understand, installHooks is performed in
> beforeIteration and it clears churn.
> 
> Suppose the following:
> 
> iteration 1 observes {PS Eden Space}.churn=10MiB
> iteration 2 observes {PS Eden Space}.churn=0
> 
> What is the expected output?
> I think current code will omit result from iteration2, thus it will
> output "average=10MiB +- NaN", while it should result in something
> like "average=5MiB +- 5MiB".
> 
> How is that supposed to work?

Note that GCProfiler.afterIteration walks the non-resettable
$observedSpaces, not $churn.keys()! Thus, once we observed the non-zero
space (hopefully during the warmup), we will expose the zero iteration
results, and they will get aggregated properly.


> I think we'd better trim zero results right in the output, not during
> collection.

That's what CODETOOLS-7901375 [1] is about. The trouble is that "only"
filtering the result during the output is not enough: profilers are free
to not to generate the result on some iterations. The correct solution
would need to be able to produce the "zero" result for any given type of
result to make the aggregation work properly.

Thanks,
-Aleksey.

[1] https://bugs.openjdk.java.net/browse/CODETOOLS-7901375




More information about the jmh-dev mailing list