# HG changeset patch # User ysr # Date 1235777447 28800 # Node ID 1fa16c3565be9e26c0b9901e241337097509fac1 # Parent 7898caac2071a844fd35c5b3f73a65413ccee8a6# Parent 59150d6667e1ee78483159b72317acac006db26a Merge diff -r 7898caac2071 -r 1fa16c3565be src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Feb 26 14:25:55 2009 -0800 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Fri Feb 27 15:30:47 2009 -0800 @@ -2626,9 +2626,8 @@ #endif // SCAN_ONLY_VERBOSE double end_time_sec = os::elapsedTime(); - if (!evacuation_failed()) { - g1_policy()->record_pause_time((end_time_sec - start_time_sec)*1000.0); - } + double pause_time_ms = (end_time_sec - start_time_sec) * MILLIUNITS; + g1_policy()->record_pause_time_ms(pause_time_ms); GCOverheadReporter::recordSTWEnd(end_time_sec); g1_policy()->record_collection_pause_end(popular_region != NULL, abandoned); diff -r 7898caac2071 -r 1fa16c3565be src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Thu Feb 26 14:25:55 2009 -0800 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Fri Feb 27 15:30:47 2009 -0800 @@ -1014,7 +1014,7 @@ _all_full_gc_times_ms->add(full_gc_time_ms); - update_recent_gc_times(end_sec, full_gc_time_sec); + update_recent_gc_times(end_sec, full_gc_time_ms); _g1->clear_full_collection(); @@ -1475,6 +1475,7 @@ size_t cur_used_bytes = _g1->used(); assert(cur_used_bytes == _g1->recalculate_used(), "It should!"); bool last_pause_included_initial_mark = false; + bool update_stats = !abandoned && !_g1->evacuation_failed(); #ifndef PRODUCT if (G1YoungSurvRateVerbose) { @@ -1535,7 +1536,7 @@ _n_pauses++; - if (!abandoned) { + if (update_stats) { _recent_CH_strong_roots_times_ms->add(_cur_CH_strong_roots_dur_ms); _recent_G1_strong_roots_times_ms->add(_cur_G1_strong_roots_dur_ms); _recent_evac_times_ms->add(evac_ms); @@ -1636,7 +1637,7 @@ double termination_time = avg_value(_par_last_termination_times_ms); double parallel_other_time; - if (!abandoned) { + if (update_stats) { MainBodySummary* body_summary = summary->main_body_summary(); guarantee(body_summary != NULL, "should not be null!"); @@ -1852,7 +1853,7 @@ // - if (!popular && !abandoned) { + if (!popular && update_stats) { double pause_time_ms = elapsed_ms; size_t diff = 0; diff -r 7898caac2071 -r 1fa16c3565be src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Thu Feb 26 14:25:55 2009 -0800 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.hpp Fri Feb 27 15:30:47 2009 -0800 @@ -966,7 +966,7 @@ record_termination_time(0, ms); } - void record_pause_time(double ms) { + void record_pause_time_ms(double ms) { _last_pause_time_ms = ms; } diff -r 7898caac2071 -r 1fa16c3565be src/share/vm/utilities/growableArray.cpp --- a/src/share/vm/utilities/growableArray.cpp Thu Feb 26 14:25:55 2009 -0800 +++ b/src/share/vm/utilities/growableArray.cpp Fri Feb 27 15:30:47 2009 -0800 @@ -43,11 +43,13 @@ #endif void* GenericGrowableArray::raw_allocate(int elementSize) { + assert(_max >= 0, "integer overflow"); + size_t byte_size = elementSize * (size_t) _max; if (on_stack()) { - return (void*)resource_allocate_bytes(elementSize * _max); + return (void*)resource_allocate_bytes(byte_size); } else if (on_C_heap()) { - return (void*)AllocateHeap(elementSize * _max, "GrET in " __FILE__); + return (void*)AllocateHeap(byte_size, "GrET in " __FILE__); } else { - return _arena->Amalloc(elementSize * _max); + return _arena->Amalloc(byte_size); } }