6908215: G1: SEGV with G1PolicyVerbose=2 debug flag

Wed, 09 Dec 2009 23:51:38 -0800

author
johnc
date
Wed, 09 Dec 2009 23:51:38 -0800
changeset 1538
9dc2adf2cbe0
parent 1530
7bfd295ec074
child 1539
27f9477e879b

6908215: G1: SEGV with G1PolicyVerbose=2 debug flag
Summary: Change CollectionSetChooser::printSortedHeapRegions to handle null entries in _markedRegions growable array.
Reviewed-by: jmasa, tonyp, iveresov

src/share/vm/gc_implementation/g1/collectionSetChooser.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Tue Dec 08 15:12:17 2009 -0800
     1.2 +++ b/src/share/vm/gc_implementation/g1/collectionSetChooser.cpp	Wed Dec 09 23:51:38 2009 -0800
     1.3 @@ -351,9 +351,16 @@
     1.4  CollectionSetChooser::printSortedHeapRegions() {
     1.5    gclog_or_tty->print_cr("Printing %d Heap Regions sorted by amount of known garbage",
     1.6                  _numMarkedRegions);
     1.7 +
     1.8 +  DEBUG_ONLY(int marked_count = 0;)
     1.9    for (int i = 0; i < _markedRegions.length(); i++) {
    1.10 -    printHeapRegion(_markedRegions.at(i));
    1.11 +    HeapRegion* r = _markedRegions.at(i);
    1.12 +    if (r != NULL) {
    1.13 +      printHeapRegion(r);
    1.14 +      DEBUG_ONLY(marked_count++;)
    1.15 +    }
    1.16    }
    1.17 +  assert(marked_count == _numMarkedRegions, "must be");
    1.18    gclog_or_tty->print_cr("Done sorted heap region print");
    1.19  }
    1.20  

mercurial