Subject: Re: PROPOSAL: removal of brk()/sbrk().
To: None <david@l8s.co.uk, greywolf@starwolf.com>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 02/28/2002 19:55:38
| With the brk/sbrk tandem we have now, things like malloc() tend to grow
| memory, and never release it because the things which get free()d
| usually live above the brk(0) point by a large margin.

Since malloc() will still have to allocate memory in page sized chunks
at least, it's unlikely that switching from sbrk() to mmap() will cause
it to start releasing address space.  Anyway, we're talking about a
demand paged VM system.  Unused pages will magrate onto swap and never
be seen again.

| Is there even the REMOTEST chance that a large chunk of free()d memory
| will actually be released back to the system for use, as in, say, the
| various operations transpiring with e.g. the X server, so that it won't
| be actually chewing up a 6MB++ RSS?

In many cases large amounts of that 6MB++ RSS is just the frame buffer.

Eduardo