From owner-freebsd-current@FreeBSD.ORG Wed Jun 14 14:25:58 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AF51616A41A; Wed, 14 Jun 2006 14:25:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD91243D45; Wed, 14 Jun 2006 14:25:57 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k5EEPoiM033749; Wed, 14 Jun 2006 10:25:54 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 14 Jun 2006 10:23:50 -0400 User-Agent: KMail/1.9.1 References: <448FC3AF.9060606@bulinfo.net> In-Reply-To: <448FC3AF.9060606@bulinfo.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200606141023.51185.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Wed, 14 Jun 2006 10:25:54 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1538/Tue Jun 13 16:17:56 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Krassimir Slavchev , jasone@freebsd.org Subject: Re: memory leak in free() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 14:25:58 -0000 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 =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org