< prev index next >

src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


5534         startTimer();
5535       }
5536       curAddr = chunk.end();
5537     }
5538     // A successful mostly concurrent collection has been done.
5539     // Because only the full (i.e., concurrent mode failure) collections
5540     // are being measured for gc overhead limits, clean the "near" flag
5541     // and count.
5542     size_policy()->reset_gc_overhead_limit_count();
5543     _collectorState = Idling;
5544   }
5545 
5546   register_gc_end();
5547 }
5548 
5549 // Same as above but for STW paths
5550 void CMSCollector::reset_stw() {
5551   // already have the lock
5552   assert(_collectorState == Resetting, "just checking");
5553   assert_lock_strong(bitMapLock());
5554   GCIdMarkAndRestore gc_id_mark(_cmsThread->gc_id());
5555   _markBitMap.clear_all();
5556   _collectorState = Idling;
5557   register_gc_end();
5558 }
5559 
5560 void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
5561   GCTraceCPUTime tcpu;
5562   TraceCollectorStats tcs(counters());
5563 
5564   switch (op) {
5565     case CMS_op_checkpointRootsInitial: {
5566       GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true);
5567       SvcGCMarker sgcm(SvcGCMarker::OTHER);
5568       checkpointRootsInitial();
5569       break;
5570     }
5571     case CMS_op_checkpointRootsFinal: {
5572       GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true);
5573       SvcGCMarker sgcm(SvcGCMarker::OTHER);
5574       checkpointRootsFinal();


   1 /*
   2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


5534         startTimer();
5535       }
5536       curAddr = chunk.end();
5537     }
5538     // A successful mostly concurrent collection has been done.
5539     // Because only the full (i.e., concurrent mode failure) collections
5540     // are being measured for gc overhead limits, clean the "near" flag
5541     // and count.
5542     size_policy()->reset_gc_overhead_limit_count();
5543     _collectorState = Idling;
5544   }
5545 
5546   register_gc_end();
5547 }
5548 
5549 // Same as above but for STW paths
5550 void CMSCollector::reset_stw() {
5551   // already have the lock
5552   assert(_collectorState == Resetting, "just checking");
5553   assert_lock_strong(bitMapLock());
5554   GCIdMark gc_id_mark(_cmsThread->gc_id());
5555   _markBitMap.clear_all();
5556   _collectorState = Idling;
5557   register_gc_end();
5558 }
5559 
5560 void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) {
5561   GCTraceCPUTime tcpu;
5562   TraceCollectorStats tcs(counters());
5563 
5564   switch (op) {
5565     case CMS_op_checkpointRootsInitial: {
5566       GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true);
5567       SvcGCMarker sgcm(SvcGCMarker::OTHER);
5568       checkpointRootsInitial();
5569       break;
5570     }
5571     case CMS_op_checkpointRootsFinal: {
5572       GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true);
5573       SvcGCMarker sgcm(SvcGCMarker::OTHER);
5574       checkpointRootsFinal();


< prev index next >