< prev index next >

src/share/vm/gc/parallel/gcTaskThread.cpp

Print this page

        

@@ -76,12 +76,14 @@
   return &(_time_stamps[index]);
 }
 
 void GCTaskThread::print_task_time_stamps() {
   assert(log_is_enabled(Debug, gc, task, time), "Sanity");
-  assert(_time_stamps != NULL, "Sanity");
 
+  // 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(),

@@ -89,10 +91,11 @@
                               time_stamp->exit_time());
   }
 
   // Reset after dumping the data
   _time_stamp_index = 0;
+  }
 }
 
 // GC workers get tasks from the GCTaskManager and execute
 // them in this method.  If there are no tasks to execute,
 // the GC workers wait in the GCTaskManager's get_task()
< prev index next >