Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8205217 | 11.0.1 | Stefan Johansson | P4 | Resolved | Fixed | team |
The improvements in JDK-6672778 complicated the timing code in G1. Since trimming of the queues, which should be accounted as object copy can happen during other phases, can happen during other phases this needs to be taken into account in the timings.
A few helper classes was added to make this code easier to follow, but there is a bug in the helper class G1EvacPhaseTimesTracker. In this class the destructor assumes that a member has already been destructed and updated another member:
G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
if (_phase_times != NULL) {
// Exclude trim time by increasing the start time.
_start_time += _trim_time;
_phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
}
}
The _trim_time member above is not updated until another member _trim_tracker has been destructed which happens after the destructor above is run.
The G1EvacPhaseTimesTracker is used for three phases ExtRootScan, ScanHCC and UpdateRS.
I've seen problems with refinement because of this. G1 report spending a lot of time in Update RS and then we activate more refinement threads to reduce this. So we get shorter pause times but spend more time concurrently which is bad for throughput.
A few helper classes was added to make this code easier to follow, but there is a bug in the helper class G1EvacPhaseTimesTracker. In this class the destructor assumes that a member has already been destructed and updated another member:
G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
if (_phase_times != NULL) {
// Exclude trim time by increasing the start time.
_start_time += _trim_time;
_phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
}
}
The _trim_time member above is not updated until another member _trim_tracker has been destructed which happens after the destructor above is run.
The G1EvacPhaseTimesTracker is used for three phases ExtRootScan, ScanHCC and UpdateRS.
I've seen problems with refinement because of this. G1 report spending a lot of time in Update RS and then we activate more refinement threads to reduce this. So we get shorter pause times but spend more time concurrently which is bad for throughput.
- backported by
-
JDK-8205217 Phase timings not updated correctly after JDK-6672778
-
- Resolved
-
- relates to
-
JDK-6672778 G1 should trim task queues more aggressively during evacuation pauses
-
- Resolved
-