:>The above perl program results in a loop more or less like:
:>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
:   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
:David Greenman
:Co-founder, The FreeBSD Project - http://www.freebsd.org

    I can significantly reduce page faulting for the above test
    (rewritten in C below) with the following:

rm /etc/malloc.conf
ln -s ">>>>>>>>>>>>" /etc/malloc.conf

    That cuts it down by a factor of 15 to 25.

                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

main(int ac, char **av)
    char *ptr = NULL;
    int i;

    for (i = 2; i < 1000000; ++i)
        ptr = realloc(ptr, i);

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

Reply via email to