phk malloc, was (Re: ptmalloc2)

Joerg Sonnenberger joerg at britannica.bec.de
Wed Feb 23 06:19:09 PST 2005


On Tue, Feb 22, 2005 at 01:50:45PM -0500, Dan Melomedman wrote:
> This begs the question whether we could have a feature to disable
> overcommit on a sysadmins', or the software's demand.

You can easily disable memory overcommit. You just have to ensure
that kern.maxproc * max(Virtual Memory Size) <= Physical Memory + Swap.

A normal system doesn't want to satisfy that relation. Any threaded program
has a acquire a fixed heap size in advance, with libthread_xu that will be
2 MB per thread. A well-written application doesn't need it under normal
circumstances. But those application don't care about about changing
the default either. Any shared mmap would have to be fully accounted to
each of programs, since the system doesn't know in advance if they won't
be remapped writeable later on. There are a lot of other examples.

To summarize this, for a normal system disabling overcommit just hurts.
It's the responsibility of the administrator to ensure that enough swap
is available or to adjust the process limits accordingly.

Joerg





More information about the Kernel mailing list