Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Feb 2001 19:59:14 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Peter Seebach <seebs@plethora.net>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Setting memory allocators for library functions.
Message-ID:  <3A988312.2E238F48@elischer.org>
References:  <200102241643.f1OGhw616627@guild.plethora.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Peter Seebach wrote:
> 
> In message <xzpu25km6mm.fsf@flood.ping.uio.no>, Dag-Erling Smorgrav writes:
> >This is all academic since FreeBSD does memory overcommit, so unless
> >you run out of address space for your process before you run out of
> >actual memory and/or swap (not likely, but quite possible) malloc()
> >will never return NULL and you won't know a thing until you dirty one
> >page too many and segfault.
> 
> Is there any hope that, some day, a setting could be provided where a program
> could request that malloc *NOT* overcommit?  There are programs which would
> rather know in advance, and clean up, than be killed abruptly.
> 

to not be caught by surprise, 
simply touch every page after you allocate it.

> (To be pedantic, this is a conformance issue.  If the memory isn't actually
> allocated, malloc shouldn't be returning a non-null pointer.)
> 
> -s
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message

-- 
      __--_|\  Julian Elischer
     /       \ julian@elischer.org
    (   OZ    ) World tour 2000-2001
---> X_.---._/  
            v

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A988312.2E238F48>