I'm afraid the problem isn't Netscape as much as its free(3). Free
doesn't call brk(2) to give the memory back to the system - at least
I've never seen it do that.

Why not? To maintain backward compatibility with programs that use both
free() and brk(). Unfortunately, one needs to use a different memory
management package to actually free and unmap pages AND I'm not aware of
any generally used package that provides a free() that automatically
calls brk when a large trailing contiguous chunk becomes free.

Such a package would sure be useful though!

Benjamin Scott wrote:
> 
> On Sun, 23 Jul 2000, Karl J. Runge wrote:
> > I've always wondered how I could limit the amount of Memory (or VM)
> > for a process. E.g. give netscape 80MB max.
> >
> > I have tried ulimit -m N and similar flags in a wrapper script
> > for netscape.  But it doesn't work as I want: netscape will grow
> > until it reaches the limit and then die due to lack of memory.
> 
>   I'm afraid that is all you are going to get.
> 
> > I want the kernel to somehow masquerade to the process that the machine
> > has less VM than it really does, thereby hopefully inducing netscape to
> > free(3) more often...
> 
>   Not gonna happen.  Programs call free() when they're done using a block of
> memory; not before, and not after.  Actually, in Netscape's case, it often
> doesn't call free() even after it's done using the memory.  :-(  You might
> find a program that will call internal garbage collection routines when a
> malloc() fails, but if Netscape was that smart, the ulimit fix would have
> worked.
> 
>   The problem is Netscape's memory management is horrid.  To paraphrase a
> certain kernel developer, it should be shown to small children when they've
> been especially bad.  :-)  The only solution is to fix Netscape.  Hopefully
> Mozilla will do that.

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to