JDK-6578316 : LinearLeastSquareFit::_sum_x_squared should be initialized
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2007-07-09
  • Updated: 2011-02-03
  • Resolved: 2011-02-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Description
In src/share/vm/gc_implementation/shared/gcUtil.hpp, the constructor for
LinearLeastSquareFit does not initialize _sum_x_squared.  It should be
initialied to zero.

Thanks to Bill Fulton of UBS for finding the problem using valgrid.
Also initialize _intercept and _slope to 0.

Comments
SUGGESTED FIX diff of src/share/vm/gc_implementation/shared/gcUtil.hpp 60c60 < AdaptiveWeightedAverage(unsigned weight) : --- > AdaptiveWeightedAverage(unsigned weight) : 146c146 < double _sum_x; // sum of all independent data points x --- > double _sum_x; // sum of all independent data points x 148,149c148,149 < double _sum_y; // sum of all dependent data points y < double _sum_xy; // sum of all x*y --- > double _sum_y; // sum of all dependent data points y > double _sum_xy; // sum of all x * y. 151,152c151 < double _slope; // slope < --- > double _slope; // slope 159,162c158 < LinearLeastSquareFit(unsigned weight) : < _sum_x(0.0), _sum_x_squared(0.0), _sum_y(0.0), _sum_xy(0.0), < _mean_x(weight), _mean_y(weight) {} < --- > LinearLeastSquareFit(unsigned weight); diff of src/share/vm/gc_implementation/shared/gcUtil.cpp 86a87,90 > LinearLeastSquareFit::LinearLeastSquareFit(unsigned weight) : > _sum_x(0), _sum_y(0), _sum_xy(0), > _mean_x(weight), _mean_y(weight) {} >
09-07-2007

EVALUATION Ok.
09-07-2007