Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 1999 10:35:42 -0700
From:      "David Schwartz" <davids@webmaster.com>
To:        "Daniel C. Sobral" <dcs@newsguy.com>
Cc:        <chat@FreeBSD.ORG>
Subject:   RE: swap-related problems
Message-ID:  <000e01be882f$8d6109e0$021d85d1@whenever.youwant.to>
In-Reply-To: <3717145B.6B4AB69F@newsguy.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> No. Not at all. This you propose is, basically, pre-allocating
> everything. The idea of non-critical processes is flawed. Go see
> previous explanations on why. In fact, the system you describe will
> tend to run only critical processes, as non-critical processes will
> tend to get killed, because they are overcommitting and the critical
> processes never get killed. Realize that the memory can become full
> without any malloc being called, just by having non-critical
> processes use their overcommitted memory. When these non-critical
> processes get killed, their memory gets used by both critical and
> non-critical processes, reducing further the space available for
> non-critical processes. From time to time, critical processes will
> have their mallocs fail, will clamp down on memory consumption, and
> maybe free some memory. The freed memory will be taken by critical
> processes which did not have their mallocs fail, and non-critical
> processes. Eventually, the process which clamped down on memory
> usage will try a malloc again, it will succeed (eventually it will
> succeed, unless you get to a stable full memory state), and it will
> get it's business going again until another malloc fails.
>
> So, your system will eventually have almost only critical processes,
> unless you have enough memory to satisfy the need of all critical
> processes, and still have enough left for non-critical processes.
> Notice that, in this case, if you were not pre-allocating then no
> process would ever get killed, because there would be enough memory
> for all. (Not true in all cases, but in most enough cases.)
>
> If you only have critical processes (plus a few non-critical ones),
> that's equivalent of pre-allocating all memory. A number of people
> have told you this wastes too much resources. If you think
> otherwise, go do the experiments I mentioned at the beginning of
> this message.

	Not so. As soon as the system has overcommitted by one byte, not a single
'critical' process will be able to allocate anything. In contrast,
non-critical processes will continue to be able to overcommit. Since we know
the system can remain stable in an overcommit situation (it does so now),
there is no reason to assume that overcommitting will ever have to lead to
any processes being killed.

	So long before critical processes can starve non-critical processes, the
reverse will occur.

	DS



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000e01be882f$8d6109e0$021d85d1>