Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/g1/heapRegionSeq.cpp @ 393:078b8a0d8d7c
6758633: G1: SEGV with GCOld on Linux
Summary: Avoid growth of a GrowableArray backend of HeapRegionSeq.
Reviewed-by: tonyp, jcoomes
author | iveresov |
---|---|
date | Mon, 13 Oct 2008 21:41:42 -0700 |
parents | 37f87013dfd8 |
children | ad8c8ca4ab0f 7d7a7c599c17 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegionSeq.cpp Thu Oct 09 12:06:22 2008 -0400 +++ b/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<HeapRegion*>), (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());