Container-aware heap sizing for OpenJDK

Jonathan Joo jonathanjoo at google.com
Wed Aug 30 20:26:39 UTC 2023


Hi Volker,

Resurrecting this thread to continue this discussion, as I created a PR to
add these counters upstream: https://github.com/openjdk/jdk/pull/15082

I think the main benefit we see from adding these counters is that it is
readily consumable and easy to parse, compared to the alternatives you
suggested. I left some further thoughts from Man and myself as a comment
here: https://bugs.openjdk.org/browse/JDK-8315149

Please let me know your thoughts!

Best,

~ Jonathan


On Mon, Oct 31, 2022 at 9:55 AM Volker Simonis <volker.simonis at gmail.com>
wrote:

> On Wed, Oct 19, 2022 at 7:15 PM Man Cao <manc at google.com> wrote:
> >
> > Hi Volker,
> >
> > Yes, we are aware of "sun.gc.collector.{0,1,2}.time", and they only
> account for pause time.
> > Accounting for only pause time does not accurately measure GC overhead
> for collectors with a large portion of concurrent work.
> > This is also the reason why heuristics based on -XX:GCTimeRatio are
> broken for G1.
> https://mail.openjdk.org/pipermail/hotspot-gc-dev/2021-May/035241.html
> has a related discussion.
> >
> > Yes, the CPU time metric sums up CPU time from all parallel GC worker
> threads and concurrent GC threads.
> > I just found https://bugs.openjdk.org/browse/JDK-8291753 which exports
> CPU time via JFR events. However, it seems to only account for CPU time
> spent during pauses, which does not cover all concurrent work. I'll do more
> digging and follow up when I create an RFE.
> >
>
> I think you're right. But we also have the
> sun.management.HotspotInternal MBean which already exports the CPU
> time for all non-Java threads through the InternalThreadCpuTimes
> attribute of the sun.management:type=HotspotThreading MBean.
> Alternatively, we can also get the CPU time of all GC threads from
> /proc/<pid>/task<thread-id>/stat (by summing up the times from all
> threads which contain GC/G1 in their name (i.e.
> /proc/<pid>/task/<tid>/comm)). This is also what
> InternalThreadCpuTimes is using to get the the CPU times of non-Java
> threads if pthread_getcpuclockid() is not available.
>
> So the question is if it is necessarily to export the CPU time of GC
> threads through hsperf at all, if we can already get this information
> from the /proc file system?
>
> > -Man
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20230830/b911650f/attachment.htm>


More information about the hotspot-gc-dev mailing list