On Mon, Nov 06, 2000 at 11:57:58AM -0500, Rick Scott wrote:
> At least 1 thing that you are missing is the granularity of the memory
> allocation scheme. From the OS perspective, if you ask for 80 bytes, this may
> come from memory allready allocated to you. However your app may not have any
> free memory, so the OS will allocate you a page of memory. A page may be, say
> 4K. So for the next ~50 allocations of 80 bytes you will not be getting anymore
> memory from the OS, simply using what you have already been given. This
> probably explains why you don't see a leak for n <= 17. This is why the leak
> tests typically loop through 10,000 iterations, to try to average out some of
> the granularity.
> 
[...]

Good point.

It also makes clear that the tests are not too precise,
in fact if really a leak exists independent of the widget
creation number, you can not get it this way. And the other way
round the claimed value is only an estimate result.

Somehow the return value being an int suggests we get an exact value here ... ;-)


OTOH while trying to make a nice plot of the "leak-function" I again ran
into a famous crash on alpha and guess I better don't search for 
a few bytes memory per widget but for something more important ...

-- 
Alexander Mai
[EMAIL PROTECTED]

Reply via email to