Print this page
rev 4518 : 8013934: Garbage collection event for CMS has wrong cause for System.gc()
Reviewed-by: brutisso, jwilhelm

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
          +++ new/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.cpp
↓ open down ↓ 132 lines elided ↑ open up ↑
 133  133      while (_slt == NULL && !_should_terminate) {
 134  134        CGC_lock->wait(true, 200);
 135  135        loopY.tick();
 136  136      }
 137  137      clear_CMS_flag(CMS_cms_wants_token);
 138  138    }
 139  139  
 140  140    while (!_should_terminate) {
 141  141      sleepBeforeNextCycle();
 142  142      if (_should_terminate) break;
 143      -    _collector->collect_in_background(false);  // !clear_all_soft_refs
      143 +    GCCause::Cause cause = _collector->_full_gc_requested ?
      144 +      _collector->_full_gc_cause : GCCause::_cms_concurrent_mark;
      145 +    _collector->collect_in_background(false, cause);
 144  146    }
 145  147    assert(_should_terminate, "just checking");
 146  148    // Check that the state of any protocol for synchronization
 147  149    // between background (CMS) and foreground collector is "clean"
 148  150    // (i.e. will not potentially block the foreground collector,
 149  151    // requiring action by us).
 150  152    verify_ok_to_terminate();
 151  153    // Signal that it is terminated
 152  154    {
 153  155      MutexLockerEx mu(Terminator_lock,
↓ open down ↓ 229 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX