Bug introduced in 6.0 and fixed in 10.2.0
NIntegrate uses memory and does not release it. For long loops with NIntegrate, memory goes up and computation slows down dramatically. Consider this specific example that uses 40 MB:
NI[z_?NumericQ, b0_?NumericQ] := NIntegrate[E^-Abs[(y - z)], {y, -b0, b0}]
m1 = MemoryInUse[];
For[i = 1, i < 10000, i++; NI[RandomReal[], .5]] // AbsoluteTiming
m2 = MemoryInUse[];
m2 - m1
Result:
{117.606048, Null}
40405872
How can we make NIntegrate release the memory?
Comments
Post a Comment