# HG changeset patch # User david # Date 1452000106 -3600 # Tue Jan 05 14:21:46 2016 +0100 # Node ID 9253e71a0d8d968525470172376bb6fabc4004af # Parent 4da38698139f16f6b3c2c2730c9350a74090657d [mq]: 8146409 diff --git a/src/share/vm/gc/parallel/gcTaskThread.cpp b/src/share/vm/gc/parallel/gcTaskThread.cpp --- a/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -78,19 +78,22 @@ void GCTaskThread::print_task_time_stamps() { assert(log_is_enabled(Debug, gc, task, time), "Sanity"); - assert(_time_stamps != NULL, "Sanity"); - log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); - for(uint i=0; i<_time_stamp_index; i++) { - GCTaskTimeStamp* time_stamp = time_stamp_at(i); - log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", - time_stamp->name(), - time_stamp->entry_time(), - time_stamp->exit_time()); + // Since _time_stamps is now lazily allocated we need to check that it + // has in fact been allocated when calling this function. + if (_time_stamps != NULL) { + log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); + for(uint i=0; i<_time_stamp_index; i++) { + GCTaskTimeStamp* time_stamp = time_stamp_at(i); + log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", + time_stamp->name(), + time_stamp->entry_time(), + time_stamp->exit_time()); + } + + // Reset after dumping the data + _time_stamp_index = 0; } - - // Reset after dumping the data - _time_stamp_index = 0; } // GC workers get tasks from the GCTaskManager and execute