comparison src/share/vm/gc_implementation/shared/allocationStats.hpp @ 3775:f75137faa7fe

6916968: CMS: freeList.cpp:304 assert(_allocation_stats.prevSweep() + ..., "Conservation Principle") Summary: Fix assert and adjust demand volume computation by adding missing factor. Reviewed-by: jmasa, tonyp
author ysr
date Mon, 20 Jun 2011 09:42:26 -0700
parents c69b1043dfb1
children f69a5d43dc19
comparison
equal deleted inserted replaced
3774:c9ca3f51cf41 3775:f75137faa7fe
97 // of accumulated data, since it has not been "integrated" 97 // of accumulated data, since it has not been "integrated"
98 // (read "low-pass-filtered") long enough, and would be 98 // (read "low-pass-filtered") long enough, and would be
99 // vulnerable to noisy glitches. In such cases, we 99 // vulnerable to noisy glitches. In such cases, we
100 // ignore the current sample and use currently available 100 // ignore the current sample and use currently available
101 // historical estimates. 101 // historical estimates.
102 // XXX NEEDS TO BE FIXED 102 assert(prevSweep() + splitBirths() + coalBirths() // "Total Production Stock"
103 // assert(prevSweep() + splitBirths() >= splitDeaths() + (ssize_t)count, "Conservation Principle"); 103 >= splitDeaths() + coalDeaths() + (ssize_t)count, // "Current stock + depletion"
104 // ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 104 "Conservation Principle");
105 // "Total Stock" "Not used at this block size"
106 if (inter_sweep_current > _threshold) { 105 if (inter_sweep_current > _threshold) {
107 ssize_t demand = prevSweep() - (ssize_t)count + splitBirths() - splitDeaths(); 106 ssize_t demand = prevSweep() - (ssize_t)count + splitBirths() + coalBirths()
108 // XXX NEEDS TO BE FIXED 107 - splitDeaths() - coalDeaths();
109 // assert(demand >= 0, "Demand should be non-negative"); 108 assert(demand >= 0,
109 err_msg("Demand (" SSIZE_FORMAT ") should be non-negative for "
110 PTR_FORMAT " (size=" SIZE_FORMAT ")",
111 demand, this, count));
110 // Defensive: adjust for imprecision in event counting 112 // Defensive: adjust for imprecision in event counting
111 if (demand < 0) { 113 if (demand < 0) {
112 demand = 0; 114 demand = 0;
113 } 115 }
114 float old_rate = _demand_rate_estimate.padded_average(); 116 float old_rate = _demand_rate_estimate.padded_average();