RFR: 8368527: JMX: Add an MXBeans method to query GC CPU time [v8]

Alan Bateman alanb at openjdk.org
Sun Oct 26 15:45:04 UTC 2025


On Sun, 26 Oct 2025 15:10:36 GMT, Jonas Norlinder <duke at openjdk.org> wrote:

> The end-goal of this test was to verify that the implementation correctly guarded against races during shutdown which it manged to test. So to that end I'm not sure this particular test needs re-work as it correctly manages to run Java code that races on this method during VM shutdown. However, if I understand your comment you are suggesting that we should (1) simplify how the test is invoked (2) add a test for checking that the value is monotonically increasing. For the latter I did not add such test as we in the end rely on`os::thread_cpu_time`.

It would be good to create unit test for the API/feature. Future maintainers will thank you. The test in the PR is focused on the shutdown scenario and be renamed to reflect that.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27537#discussion_r2463885768


More information about the serviceability-dev mailing list