RFR: 8359110: Log accumulated GC and process CPU time upon VM exit [v5]
David Holmes
dholmes at openjdk.org
Mon Jun 16 07:43:32 UTC 2025
On Fri, 13 Jun 2025 20:11:04 GMT, Jonas Norlinder <duke at openjdk.org> wrote:
>> Add support to log CPU cost for GC during VM exit with `-Xlog:gc`.
>>
>>
>> [1.500s][info ][gc] GC CPU cost: 1.75%
>>
>>
>> Additionally, detailed information may be retrieved with `-Xlog:gc=trace`
>>
>>
>> [1.500s][trace][gc] Process CPU time: 4.945370s
>> [1.500s][trace][gc] GC CPU time: 0.086382s
>> [1.500s][info ][gc] GC CPU cost: 1.75%
>
> Jonas Norlinder has updated the pull request incrementally with one additional commit since the last revision:
>
> Add CPU time tracking for string deduplication to log_gc_vtime
This seems reasonable though I'm unclear on some details. Could you give a high-level description of what times we capture for what threads and when, and the calculations involved. Thanks.
Some minor style nits.
src/hotspot/share/gc/shared/vtimeScope.hpp line 38:
> 36:
> 37: public:
> 38: VTimeScope(VMThread *thread, bool operation_is_gc);
Suggestion:
VTimeScope(VMThread* thread, bool operation_is_gc);
src/hotspot/share/gc/shared/vtimeScope.inline.hpp line 32:
> 30: #include "runtime/os.hpp"
> 31:
> 32: inline VTimeScope::VTimeScope(VMThread *thread, bool operation_is_gc)
Suggestion:
inline VTimeScope::VTimeScope(VMThread* thread, bool operation_is_gc)
This style nit needs fixing in a few places.
src/hotspot/share/gc/shared/vtimeScope.inline.hpp line 35:
> 33: : _start(0), _enabled(os::is_thread_cpu_time_supported()),
> 34: _gcLogging(operation_is_gc && (log_is_enabled(Info, gc) || log_is_enabled(Info, gc, cpu))),
> 35: _thread((Thread*)thread) {
Cast should not be necessary
-------------
PR Review: https://git.openjdk.org/jdk/pull/25779#pullrequestreview-2930801029
PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2149153155
PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2149153527
PR Review Comment: https://git.openjdk.org/jdk/pull/25779#discussion_r2149153897
More information about the hotspot-gc-dev
mailing list