RFR (S) 8247615: Initialize the bytes left for the heap sampler

Derek Thomson dthomson at google.com
Fri Jun 26 01:53:54 UTC 2020


> It could also avoid the problem where every thread deterministically
allocates the same object at 512K, although this is unlikely.

I've recently discovered that with certain server frameworks that this
actually becomes quite likely! So I'd strongly recommend using
pick_next_sample.

On Thu, Jun 25, 2020 at 4:56 PM Man Cao <manc at google.com> wrote:

> Thanks for fixing this!
>
> > 53 ThreadHeapSampler() : _bytes_until_sample(get_sampling_interval())  {
>
> Does this work better? (It has to be done after the initialization of
> _rnd.)
> _bytes_until_sample = pick_next_sample();
>
> It could avoid completely missing to sample the first 512K allocation.
> It could also avoid the problem where every thread deterministically
> allocates the same object at 512K, although this is unlikely.
>
> -Man
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20200625/b0ad542d/attachment.htm>


More information about the serviceability-dev mailing list