malloc() over 4Gb

ml at ml at
Tue Feb 17 00:21:23 PST 2004

obrien at wrote:
> On Mon, Feb 16, 2004 at 02:00:39PM +0000, ml at wrote:
> > I went out and bought the box and it does indeed seem to malloc() over
> > 4Gb. However, if you change the allocation from 7*GB to 8*GB in your
> > sample program, it still keels over inside malloc()!
> Define 'keels over'.  Details please.

I could have been clearer, yes....

With the GENERIC kernel, attempting to malloc 8Gb of RAM causes a
SIGSEGV deep within malloc(). The stack trace indicates it crashes in
tcflow() which is called by malloc().

However, I've found MAXDSIZ in the kernel which was set to 8192*1024*1024.
As a result, I've built a new kernel resetting that to 32768*1024*1024 and that
seems to work fine now.

That said, I'm pretty certain malloc() ain't supposed to crash when MAXDSIZ is
hit. I'd expect a NULL to be returned.

All this fun and games on 5.2-RELEASE for AMD64.

> -- David  (obrien at



More information about the freebsd-amd64 mailing list