Re: 2.2.17pre9 can't allocate more than 900MB

Mark Hahn (hahn@coffee.psychology.mcmaster.ca)
Thu, 29 Jun 2000 15:24:05 -0400 (EDT)


> It fails in the exact same spot. I suspect something else at work here.

there's nothing "at work" here. this is expected behavior:
small mallocs allocate from the heap, and brk/sbrk hits the
beginning of mmaped areas at 1G. glibc malloc will allocate
big chunks using mmap (and thus deliver around 2G); a better
malloc would fall back to mmaped arenas when brk/sbrk fails.

I think our VM layout is somewhat unfortunate, since it's
based on:
- text is mapped at ~128M;
- heap grows up from from the end of text;
- mmap's grow up from 1G;
- stack grows down from 3G.

I'd prefer to have only a smallish area for stack, then have mmap's
grow down towards heap. can't we find a way for the rare program that
uses lots of stack (fortran, mostly) to signal this to ld.so?
do we still need the >3G area reserved for the system?
for that matter, why does text start at 0x08048000?

btw, there's no problem with hacking a kernel to leave more space
for the heap, or even to move 3G up somewhat. I'm just suggesting
that instead of having two up-growers and a down-, we have one up
(heap) and one down (mmaps), with stack relegated to a fixed size.

regards, mark hahn.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/