Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2006 10:23:50 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-current@freebsd.org
Cc:        Krassimir Slavchev <krassi@bulinfo.net>, jasone@freebsd.org
Subject:   Re: memory leak in free()
Message-ID:  <200606141023.51185.jhb@freebsd.org>
In-Reply-To: <448FC3AF.9060606@bulinfo.net>
References:  <448FC3AF.9060606@bulinfo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 14 June 2006 04:07, Krassimir Slavchev wrote:
> Hello,
>=20
> This simple code demonstrates the problem:
>=20
> int main ()
> {
>     char* buffer1;
>     char* buffer2;
>     int size =3D 2*1024*1024 + 1;
>=20
> for(;;) {
>         buffer1 =3D (char *) malloc(size);
>         buffer2 =3D (char *) malloc(size);
>=20
>         free(buffer1);
>         free(buffer2);
>  }
> }
>=20
> The second free() does not free allocated memory if size >2Mb.
>=20
> On 6.1-STABLE all is OK.

This is probably an issue with jemalloc, I've cc'd jasone@ who wrote the
new malloc() in HEAD.

=2D-=20
John Baldwin <jhb@FreeBSD.org> =A0<>< =A0http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org



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