1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Tue Apr 06 10:59:45 2010 -0400 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Apr 07 11:43:53 2010 -0700 1.3 @@ -2942,6 +2942,9 @@ 1.4 // the same region 1.5 assert(r == NULL || !r->is_gc_alloc_region(), 1.6 "shouldn't already be a GC alloc region"); 1.7 + assert(r == NULL || !r->isHumongous(), 1.8 + "humongous regions shouldn't be used as GC alloc regions"); 1.9 + 1.10 HeapWord* original_top = NULL; 1.11 if (r != NULL) 1.12 original_top = r->top(); 1.13 @@ -3084,12 +3087,17 @@ 1.14 1.15 if (alloc_region->in_collection_set() || 1.16 alloc_region->top() == alloc_region->end() || 1.17 - alloc_region->top() == alloc_region->bottom()) { 1.18 - // we will discard the current GC alloc region if it's in the 1.19 - // collection set (it can happen!), if it's already full (no 1.20 - // point in using it), or if it's empty (this means that it 1.21 - // was emptied during a cleanup and it should be on the free 1.22 - // list now). 1.23 + alloc_region->top() == alloc_region->bottom() || 1.24 + alloc_region->isHumongous()) { 1.25 + // we will discard the current GC alloc region if 1.26 + // * it's in the collection set (it can happen!), 1.27 + // * it's already full (no point in using it), 1.28 + // * it's empty (this means that it was emptied during 1.29 + // a cleanup and it should be on the free list now), or 1.30 + // * it's humongous (this means that it was emptied 1.31 + // during a cleanup and was added to the free list, but 1.32 + // has been subseqently used to allocate a humongous 1.33 + // object that may be less than the region size). 1.34 1.35 alloc_region = NULL; 1.36 }