< prev index next >

src/hotspot/share/services/memoryManager.cpp

Print this page

        

@@ -208,11 +208,13 @@
   // hold the publicly available "last (completed) gc" information.
 }
 
 void GCMemoryManager::gc_begin(bool recordGCBeginTime, bool recordPreGCUsage,
                                bool recordAccumulatedGCTime) {
-  assert(_last_gc_stat != NULL && _current_gc_stat != NULL, "Just checking");
+  // Inactive memory managers (concurrent in G1 legacy mode) will not be initialized.
+  if (_last_gc_stat == NULL && _current_gc_stat == NULL) return;
+
   if (recordAccumulatedGCTime) {
     _accumulated_timer.start();
   }
   // _num_collections now increases in gc_end, to count completed collections
   if (recordGCBeginTime) {

@@ -241,10 +243,12 @@
 void GCMemoryManager::gc_end(bool recordPostGCUsage,
                              bool recordAccumulatedGCTime,
                              bool recordGCEndTime, bool countCollection,
                              GCCause::Cause cause,
                              bool allMemoryPoolsAffected) {
+  if (_last_gc_stat == NULL && _current_gc_stat == NULL) return;
+
   if (recordAccumulatedGCTime) {
     _accumulated_timer.stop();
   }
   if (recordGCEndTime) {
     _current_gc_stat->set_end_time(Management::timestamp());
< prev index next >