comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 7:2faf283ce688

6621144: CMS: assertion failure "is_cms_thread == Thread::current()->is_ConcurrentGC_thread()" Summary: Take lock conditionally (in asynchronous mode only) when updating the dead-object map. Reviewed-by: jmasa
author ysr
date Sat, 16 Feb 2008 22:41:20 -0800
parents a61af66fc99e
children 173195ff483a
comparison
equal deleted inserted replaced
6:73e96e5c30df 7:2faf283ce688
5730 // PermGen verification support: If perm gen sweeping is disabled in 5730 // PermGen verification support: If perm gen sweeping is disabled in
5731 // this cycle, we preserve the perm gen object "deadness" information 5731 // this cycle, we preserve the perm gen object "deadness" information
5732 // in the perm_gen_verify_bit_map. In order to do that we traverse 5732 // in the perm_gen_verify_bit_map. In order to do that we traverse
5733 // all blocks in perm gen and mark all dead objects. 5733 // all blocks in perm gen and mark all dead objects.
5734 if (verifying() && !cms_should_unload_classes()) { 5734 if (verifying() && !cms_should_unload_classes()) {
5735 CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
5736 bitMapLock());
5737 assert(perm_gen_verify_bit_map()->sizeInBits() != 0, 5735 assert(perm_gen_verify_bit_map()->sizeInBits() != 0,
5738 "Should have already been allocated"); 5736 "Should have already been allocated");
5739 MarkDeadObjectsClosure mdo(this, _permGen->cmsSpace(), 5737 MarkDeadObjectsClosure mdo(this, _permGen->cmsSpace(),
5740 markBitMap(), perm_gen_verify_bit_map()); 5738 markBitMap(), perm_gen_verify_bit_map());
5741 _permGen->cmsSpace()->blk_iterate(&mdo); 5739 if (asynch) {
5740 CMSTokenSyncWithLocks ts(true, _permGen->freelistLock(),
5741 bitMapLock());
5742 _permGen->cmsSpace()->blk_iterate(&mdo);
5743 } else {
5744 // In the case of synchronous sweep, we already have
5745 // the requisite locks/tokens.
5746 _permGen->cmsSpace()->blk_iterate(&mdo);
5747 }
5742 } 5748 }
5743 5749
5744 if (asynch) { 5750 if (asynch) {
5745 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); 5751 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty);
5746 CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails); 5752 CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails);