Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 06 Dec 2000 17:23:30 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        remy@boostworks.com
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: free() not freing pagedirs pages. 
Message-ID:  <51350.976119810@critter>
In-Reply-To: Your message of "Wed, 06 Dec 2000 17:11:53 %2B0100." <200012061612.RAA30340@luxren2.boostworks.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200012061612.RAA30340@luxren2.boostworks.com>, Remy Nonnenmacher wr
ites:

>>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.

That is actually not correct.  the pagedir is allocated with mmap
from anonymous memory and does not affect the sbrk(2)'ing.

>It seems to be a problem also in some other Unixes, anyway, but i would
>like to know if:

Presuming your question then is "can the pagedir be shrunk ?" the 
answers are:

>1) This is historical and must not be fixed.

no.

>2) This can be easily fixed.

maybe.

>3) Fixing it would lead to enormous problems. Better keep it like this.

unlikely.

Have you read the paper in src/share/doc/papers/malloc ?

Also, if you are truly concerned with the returning to the OS of
memory, examine the 'H' option to phkmalloc.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




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