comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 807:d44bdab1c03d

6843694: G1: assert(index < _vs.committed_size(),"bad index"), g1BlockOffsetTable.inline.hpp:55 Summary: For heaps larger than 32Gb, the number of heap regions overflows the data type used to hold the region index in the SparsePRT structure. Changed the region indexes, card indexes, and RSet hash table buckets to ints and added some size overflow guarantees. Reviewed-by: ysr, tonyp
author johnc
date Thu, 11 Jun 2009 17:19:33 -0700
parents 29e7d79232b9
children 830ca2573896
comparison
equal deleted inserted replaced
806:821269eca479 807:d44bdab1c03d
1532 _g1_committed = MemRegion((HeapWord*)_g1_storage.low(), (size_t) 0); 1532 _g1_committed = MemRegion((HeapWord*)_g1_storage.low(), (size_t) 0);
1533 _g1_max_committed = _g1_committed; 1533 _g1_max_committed = _g1_committed;
1534 _hrs = new HeapRegionSeq(_expansion_regions); 1534 _hrs = new HeapRegionSeq(_expansion_regions);
1535 guarantee(_hrs != NULL, "Couldn't allocate HeapRegionSeq"); 1535 guarantee(_hrs != NULL, "Couldn't allocate HeapRegionSeq");
1536 guarantee(_cur_alloc_region == NULL, "from constructor"); 1536 guarantee(_cur_alloc_region == NULL, "from constructor");
1537
1538 // 6843694 - ensure that the maximum region index can fit
1539 // in the remembered set structures.
1540 const size_t max_region_idx = ((size_t)1 << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1;
1541 guarantee((max_regions() - 1) <= max_region_idx, "too many regions");
1542
1543 const size_t cards_per_region = HeapRegion::GrainBytes >> CardTableModRefBS::card_shift;
1544 size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
1545 guarantee(cards_per_region < max_cards_per_region, "too many cards per region");
1537 1546
1538 _bot_shared = new G1BlockOffsetSharedArray(_reserved, 1547 _bot_shared = new G1BlockOffsetSharedArray(_reserved,
1539 heap_word_size(init_byte_size)); 1548 heap_word_size(init_byte_size));
1540 1549
1541 _g1h = this; 1550 _g1h = this;