Relates :
|
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.