comparison src/share/vm/gc_implementation/g1/collectionSetChooser.cpp @ 1103:9dc2adf2cbe0

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
author johnc
date Wed, 09 Dec 2009 23:51:38 -0800
parents bd02caa94611
children c18cbe5936b8
comparison
equal deleted inserted replaced
1095:7bfd295ec074 1103:9dc2adf2cbe0
349 349
350 void 350 void
351 CollectionSetChooser::printSortedHeapRegions() { 351 CollectionSetChooser::printSortedHeapRegions() {
352 gclog_or_tty->print_cr("Printing %d Heap Regions sorted by amount of known garbage", 352 gclog_or_tty->print_cr("Printing %d Heap Regions sorted by amount of known garbage",
353 _numMarkedRegions); 353 _numMarkedRegions);
354
355 DEBUG_ONLY(int marked_count = 0;)
354 for (int i = 0; i < _markedRegions.length(); i++) { 356 for (int i = 0; i < _markedRegions.length(); i++) {
355 printHeapRegion(_markedRegions.at(i)); 357 HeapRegion* r = _markedRegions.at(i);
356 } 358 if (r != NULL) {
359 printHeapRegion(r);
360 DEBUG_ONLY(marked_count++;)
361 }
362 }
363 assert(marked_count == _numMarkedRegions, "must be");
357 gclog_or_tty->print_cr("Done sorted heap region print"); 364 gclog_or_tty->print_cr("Done sorted heap region print");
358 } 365 }
359 366
360 void CollectionSetChooser::removeRegion(HeapRegion *hr) { 367 void CollectionSetChooser::removeRegion(HeapRegion *hr) {
361 int si = hr->sort_index(); 368 int si = hr->sort_index();