--- old/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp 2015-03-03 17:05:48.559761743 +0100 +++ new/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp 2015-03-03 17:05:48.455761748 +0100 @@ -125,6 +125,10 @@ template void WorkerDataArray::verify() { + if (!_enabled) { + return; + } + for (uint i = 0; i < _length; i++) { assert(_data[i] != WorkerDataArray::uninitialized(), err_msg("Invalid data for worker %u in '%s'", i, _title)); @@ -312,11 +316,15 @@ G1GCPhaseTimesTracker::G1GCPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCPhases phase, uint worker_id) : _phase_times(phase_times), _phase(phase), _worker_id(worker_id) { - _start_time = os::elapsedTime(); + if (_phase_times != NULL) { + _start_time = os::elapsedTime(); + } } G1GCPhaseTimesTracker::~G1GCPhaseTimesTracker() { - _phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time); + if (_phase_times != NULL) { + _phase_times->record_time_secs(_phase, _worker_id, os::elapsedTime() - _start_time); + } } void G1GCPhasePrinter::print_single_length(G1GCPhaseTimes::GCPhases phase_id, WorkerDataArray* phase) {