Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jul 2003 06:26:34 -0700 (PDT)
From:      Jamie Bowden <ragnar@sysabend.org>
To:        Don Lewis <truckman@FreeBSD.org>
Cc:        gabor@vmunix.com
Subject:   Re: malloc does not return null when out of memory
Message-ID:  <20030724062152.G50019-100000@moo.sysabend.org>
In-Reply-To: <200307240152.h6O1qCM7053256@gw.catspoiler.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 23 Jul 2003, Don Lewis wrote:

> On 23 Jul, Brooks Davis wrote:
> > On Thu, Jul 24, 2003 at 12:36:54AM +0200, Matthias Buelow wrote:

> >> Wasn't there a sysctl flag to enable/disable overcommitting?
> >> I think I remember something but I can't find it; it might
> >> not have been on FreeBSD.

> > No there isn't.  Overcommit is a fundamental design feature of the BSD
> > VM.  If you don't like it, find an OS that doesn't do it.  The only one
> > I can think of off the top of my head in Irix where I've found it to be
> > a serious pain in the ass.
>
> I think it's a pain in the ass when swap runs out and the kernel decides
> to kill off my X11 server to fix the problem.  In addition to losing
> everything I'm working on, it also hoses the console.  The only reason
> that I can avoid having to hit the reset switch and risking further
> system damage is that I have another machine that I can ssh in from to
> do a clean shutdown.

Irix allows for use of what it calls 'vswap' as well, which is just a file
that lives on a normal filesystem that the system can fall back on when
actual RAM and swap are exhausted.  It allows for extremely large commits
on memory limited systems while guaranteeing that it has somewhere to page
out to if necessary.  The poster above may not like Irix, but I do.
There's a lot of good stuff in there, but SGI aren't the best at telling
people it exists and how to use it.

> I used SunOS 4.x, which did not overcommit, for many years.  Its typical
> failure mode when swap was exhausted is that large processes would get a
> error when they attempted to fork() and large memory alloction requests
> would fail.  Everything else would generally keep working because
> smaller memory allocation requests would still succeed. This usually
> gave me enough time to take corrective action (generally by cleaning up
> junk files in /tmp which was a tmpfs mount).

My experience with SunOS 4.x was mostly positive (I chose FreeBSD over
Linux/Slakware back in 94 due to FBSD being far closer to what I dealt
with daily), but never with respect to running out of system resources.
SunOS was happy right up to the point where it started screaming and then
usually panic'd.

Jamie Bowden

-- 
"It was half way to Rivendell when the drugs began to take hold"
Hunter S Tolkien "Fear and Loathing in Barad Dur"
Iain Bowen <alaric@alaric.org.uk>




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