diff -r 1b2e3dd02107 -r ec7818f129f8 hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Thu Oct 09 12:06:22 2008 -0400 +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Mon Oct 13 21:41:42 2008 -0700 @@ -37,7 +37,7 @@ return 0; } -HeapRegionSeq::HeapRegionSeq() : +HeapRegionSeq::HeapRegionSeq(const size_t max_size) : _alloc_search_start(0), // The line below is the worst bit of C++ hackery I've ever written // (Detlefs, 11/23). You should think of it as equivalent to @@ -50,7 +50,7 @@ _regions((ResourceObj::operator new (sizeof(GrowableArray), (void*)&_regions, ResourceObj::C_HEAP), - 100), + (int)max_size), true), _next_rr_candidate(0), _seq_bottom(NULL) @@ -167,6 +167,7 @@ // Public methods. void HeapRegionSeq::insert(HeapRegion* hr) { + assert(!_regions.is_full(), "Too many elements in HeapRegionSeq"); if (_regions.length() == 0 || _regions.top()->end() <= hr->bottom()) { hr->set_hrs_index(_regions.length());