Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2006 11:07:11 +0300
From:      Krassimir Slavchev <krassi@bulinfo.net>
To:        freebsd-current@freebsd.org
Subject:   memory leak in free()
Message-ID:  <448FC3AF.9060606@bulinfo.net>

next in thread | raw e-mail | index | archive | help
Hello,

This simple code demonstrates the problem:

int main ()
{
    char* buffer1;
    char* buffer2;
    int size = 2*1024*1024 + 1;

for(;;) {
        buffer1 = (char *) malloc(size);
        buffer2 = (char *) malloc(size);

        free(buffer1);
        free(buffer2);
 }
}

The second free() does not free allocated memory if size >2Mb.

On 6.1-STABLE all is OK.

Best Regards




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?448FC3AF.9060606>