Date: Thu, 24 Jul 2003 16:59:30 +0100 From: "Muttley" <muttley@nildram.co.uk> To: "Chuck Swiger" <cswiger@mac.com>, "freebsd-stable@freebsd.org"@smithers.nildram.co.uk Subject: Re: malloc does not return null when out of memory Message-ID: <20030724155926.7305F231C11@smithers.nildram.co.uk>
next in thread | raw e-mail | index | archive | help
Yes, I thought briefly about something like this. Then I thought 'there's a race condition'. Then I realised that other processes might not link against this malloc. Then I realised the race condition doesn't even matter; processes will still be killed, as the kernel doesn't care that you're still in malloc() when the overcommitted memory is touched, it just knows you've touched it and there's no actual memory there. This will result in far more processes being killed. I believe that's a bad thing. Any patch for this is going to have to be in kernelland not userland. Cheers, Matt From: "Chuck Swiger" <cswiger@mac.com> Date: 24/07/03 15:16 I don't think the following is a particularly good idea, as the existing prezero ('Z') or junk ('J') options will also serve to reference memory and prevent the "memory overcommit issue", but: <patch to touch memory just after it's sbrk'd>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030724155926.7305F231C11>