comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 1720:5ed703250bff

6977970: CMS: concurrentMarkSweepGeneration.cpp:7947 assert(addr <= _limit) failed: sweep invariant Summary: Allow for the possibility (when the heap is expanding) that the sweep might skip over and past, rather than necessarily step on, the sweep limit determined at the beginning of a concurrent marking cycle. Reviewed-by: jmasa, tonyp
author ysr
date Wed, 18 Aug 2010 11:39:21 -0700
parents be3f9c242c9d
children 179464550c7d
comparison
equal deleted inserted replaced
1719:b63010841f78 1720:5ed703250bff
7935 7935
7936 size_t SweepClosure::do_blk_careful(HeapWord* addr) { 7936 size_t SweepClosure::do_blk_careful(HeapWord* addr) {
7937 FreeChunk* fc = (FreeChunk*)addr; 7937 FreeChunk* fc = (FreeChunk*)addr;
7938 size_t res; 7938 size_t res;
7939 7939
7940 // check if we are done sweepinrg 7940 // Check if we are done sweeping. Below we check "addr >= _limit" rather
7941 if (addr == _limit) { // we have swept up to the limit, do nothing more 7941 // than "addr == _limit" because although _limit was a block boundary when
7942 // we started the sweep, it may no longer be one because heap expansion
7943 // may have caused us to coalesce the block ending at the address _limit
7944 // with a newly expanded chunk (this happens when _limit was set to the
7945 // previous _end of the space), so we may have stepped past _limit; see CR 6977970.
7946 if (addr >= _limit) { // we have swept up to or past the limit, do nothing more
7942 assert(_limit >= _sp->bottom() && _limit <= _sp->end(), 7947 assert(_limit >= _sp->bottom() && _limit <= _sp->end(),
7943 "sweep _limit out of bounds"); 7948 "sweep _limit out of bounds");
7949 assert(addr < _sp->end(), "addr out of bounds");
7944 // help the closure application finish 7950 // help the closure application finish
7945 return pointer_delta(_sp->end(), _limit); 7951 return pointer_delta(_sp->end(), addr);
7946 } 7952 }
7947 assert(addr <= _limit, "sweep invariant"); 7953 assert(addr < _limit, "sweep invariant");
7948 7954
7949 // check if we should yield 7955 // check if we should yield
7950 do_yield_check(addr); 7956 do_yield_check(addr);
7951 if (fc->isFree()) { 7957 if (fc->isFree()) {
7952 // Chunk that is already free 7958 // Chunk that is already free