RFR: 8241160: Concurrent class unloading reports GCTraceTime events as JFR pause sub-phase events

Kim Barrett kim.barrett at oracle.com
Wed Mar 25 22:37:29 UTC 2020


> On Mar 19, 2020, at 5:44 AM, Stefan Karlsson <stefan.karlsson at oracle.com> wrote:
> 
> Hi all,
> 
> Please review this patch to rewrite the GCTimer, and associated classes, to not allow nested phases of different types (pause or concurrent).
> 
> https://cr.openjdk.java.net/~stefank/8241160/webrev.01/
> https://bugs.openjdk.java.net/browse/JDK-8241160

Looks good.

------------------------------------------------------------------------------
src/hotspot/share/gc/shared/gcTimer.cpp
 105 GCPhase::PhaseType TimePartitions::current_phase_type() const {
 106   int level = _active_phases.count();
 107   int index = _active_phases.phase_index(level - 1);

Maybe assert level > 0.  No need for a new webrev if you want to make
this change.

------------------------------------------------------------------------------
src/hotspot/share/gc/shared/gcTraceSend.cpp
 306     assert(phase->level() < 2, "There is only two levels for ConcurrentPhase");

Seems like there ought to be a named constant for that "2", similar to
PhasesStack::PHASE_LEVELS used in a similar place in visit_pause. But
then, there's a mismatch between PHASE_LEVELS (6) and the number of
cases in visit_pause (4). That's "interesting"...

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




More information about the hotspot-gc-dev mailing list