Date: Wed, 14 Apr 1999 18:30:02 -0500 (EST) From: Alfred Perlstein <bright@rush.net> To: Andrew Reilly <andrew@lake.com.au> Cc: alk@pobox.com, dcs@newsguy.com, current@FreeBSD.ORG Subject: Re: swap-related problems Message-ID: <Pine.BSF.3.96.990414182526.4169i-100000@cygnus.rush.net> In-Reply-To: <19990415083720.A1870@reilly.home>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 15 Apr 1999, Andrew Reilly wrote: > On Wed, Apr 14, 1999 at 02:55:27PM -0500, Anthony Kimball wrote: > > > > : > All I want is that a program gets NULL from malloc if there is no memory > > : > available. I find that to be a very fundamental thing about malloc. > > > > : Do you have a solution? We don't. > > > > Make an sbrk variant which will pre-allocate backing store. > > setenv MALLOC_PREALLOCATE > > > > Not so hard. > > You could do this yourself, I think, by: > > 1) create your own backing file of the appropriate size > 2) mmap it into your address space > 3) tell your own malloc() routine that that's where it should > get memory from. > > Any problems with that? (besides not being the system standard, > and the reduction of swapping efficiency caused by going through > the file system). actually doesn't the BSD mmap spec state that if you map anything anon without special flags and there is no backing store available that the call will fail, and that there is a way to pass a flag to tell the system to overcommit but that you are prepared to take a SIGSEGV if you do cause the system to run out of backing store on the mepped object? looking at the manpages it seems that this is either undocumented or was never completed. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990414182526.4169i-100000>