From owner-freebsd-hackers Wed Dec 6 8:12:35 2000 From owner-freebsd-hackers@FreeBSD.ORG Wed Dec 6 08:12:34 2000 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from luxren2.boostworks.com (luxren2.boostworks.com [194.167.81.214]) by hub.freebsd.org (Postfix) with ESMTP id D04DB37B400 for ; Wed, 6 Dec 2000 08:12:25 -0800 (PST) Received: from boostworks.com (root@oldrn.luxdev.boostworks.com [192.168.1.99]) by luxren2.boostworks.com (8.9.1/8.9.1) with ESMTP id RAA30340 for ; Wed, 6 Dec 2000 17:12:17 +0100 (CET) Message-Id: <200012061612.RAA30340@luxren2.boostworks.com> Date: Wed, 6 Dec 2000 17:11:53 +0100 (CET) From: Remy Nonnenmacher Reply-To: remy@boostworks.com Subject: free() not freing pagedirs pages. To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/plain; CHARSET=US-ASCII Sender: root@boostworks.com Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello, I'm encountering a problem with the stardard libc malloc/free library. if a program allocates a huge (and temporary) amount of memory with small structures then free it, the library gives back only a few pages to the system. From the /usr/src/lib/libc/stdlib/malloc.c sources, it seems that this is due to not shrinking/relocating pagedir pages (free_pages(), comment around line 940). This means that returning pages stop at first allocated pagedir. It seems to be a problem also in some other Unixes, anyway, but i would like to know if: 1) This is historical and must not be fixed. 2) This can be easily fixed. 3) Fixing it would lead to enormous problems. Better keep it like this. Thanks. RN. IhM To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message