>The above perl program results in a loop more or less like:
>
>       n = 2
>       for (i = 0; i < 1000000; i++)
>               realloc(n++);
>
>Now, if you read _any_ malloc(3) man page, they will tell you that there
>is no way it can be guaranteed that this does not result in a lot of
>copying.

   Um, except that copying isn't what is causing the problem. The performance
problem is apparantly caused by tens of thousands of page faults per second as
the memory is freed and immediately reallocated again from the kernel. Doesn't
phkmalloc keep a small pool of allocations around to avoid problems like
this?

-DG

David Greenman
Co-founder, The FreeBSD Project - http://www.freebsd.org
President, TeraSolutions, Inc. - http://www.terasolutions.com
President, Download Technologies, Inc. - http://www.downloadtech.com
Pave the road of life with opportunities.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to