*BSD News Article 54985


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yarrina.connect.com.au!news.mel.aone.net.au!usenet
From: tim@cst.com.au (Tim Liddelow)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: FreeBSD malloc() not returning NULL when vm exhausted ?
Date: 15 Nov 1995 23:31:56 GMT
Organization: Labtam Australia Pty. Ltd., Melbourne Australia
Lines: 15
Distribution: world
Message-ID: <48dt9c$r67@news.mel.aone.net.au>
Reply-To: tim@cst.com.au
NNTP-Posting-Host: titanic.labtam.oz.au

Just wondering about malloc() in FreeBSD - I grabbed a small test program
that simply allocates memory in larger and larger chunks until malloc
_should_ return NULL.  However, a recent (2 months ago) SNAP of FreeBSD 
didn't do this - the OS 'stepped in' and killed the process.  I tested this
same app on NetBSD, and NetBSD malloc does indeed return NULL, which allows
the app to atleast recognise that it is out of memory.  Has this been fixed in
FreeBSD-current ?

Note: This is not a NetBSD/FreeBSD political exercise, just an observation :)