Date: Thu, 24 Jul 2003 15:09:27 -0400 From: Gabor <gabor@vmunix.com> To: freebsd-stable@freebsd.org Subject: Re: malloc does not return null when out of memory Message-ID: <20030724190927.GA87428@vmunix.com> In-Reply-To: <20030724181326.GA41709@pit.databus.com> References: <20030723221336.GA26555@pit.databus.com> <200307232222.PAA26360@mina.soco.agilent.com> <20030724180106.GA86680@vmunix.com> <20030724181326.GA41709@pit.databus.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 24, 2003 at 02:13:26PM -0400, Barney Wolff wrote: # On Thu, Jul 24, 2003 at 02:01:06PM -0400, Gabor wrote: # > ... # > Here is another test. This box has swap and I get a null pointer even # > though ulimit -a says memory unlimited. # > ... # > 5242 0x2801d000 # > 5243 0x0 # > No more mem # > # ulimit -a # > data(kbytes) 524288 <<<<<<<<<<<<<<<<<<<<<<< Ah, I am a cone head! I fired up four of my test procs and put in an infinite while after they ran out of memory. After starting the fourth and it chugging away eating up swap, one of the other three got killed off. So at least I know it has nothing to do with the NO_SWAPPING option. It's still disconcerting to me. I would much prefer to get back a null pointer that just have the kernel randomly pick a victim who's a high memory user. It's like a starving guy being given food and then being shot in the head when he reaches for it.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030724190927.GA87428>