On Thu, Nov 17, 2011 at 10:07 PM, Greg Matthews
<gregory(dot)a(dot)matthews(at)nasa(dot)gov> wrote:
> if (smoothed_alloc <= (float) recent_alloc)
> smoothed_alloc = recent_alloc;
> else if (smoothed_alloc >= 0.00001)
> smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
> smoothing_samples;
>
I don't think that logic is sound.
Rather,
if (smoothed_alloc <= (float) recent_alloc) {
smoothed_alloc = recent_alloc;
} else {
if (smoothed_alloc < 0.000001)
smoothed_alloc = 0;
smoothed_alloc += ((float) recent_alloc - smoothed_alloc) /
smoothing_samples;
}