Re: maximum memory limit

From: Wolfram Gloger (Wolfram.Gloger@dent.med.uni-muenchen.de)
Date: Wed Feb 09 2000 - 06:43:45 EST


> From: Rik van Riel <riel@nl.linux.org>
>
> On Tue, 8 Feb 2000, Lee Chin wrote:
>
> > Just to make sure I have this correct, an application can call brk
> > to allocate memory from its heap space for upto 1GB, after which
> > it has to switch to using mmap for the rest. Is this 1GB fixed or
> > will it ever change? (if it does, it might break my application).
>
> IMHO malloc() should switch to mmap() for the rest :)
>
> > >around 900M if the malloc uses sbrk, but more if it uses mmap.
> > >modern libc's will use mmap for large allocations, since unlike
> > >sbrk, mmap can actually free memory back to the OS.
> >
> > Which version of libc has malloc that uses mmap after 1GB?
>
> None, AFAIK. They use mmap() when you malloc() bigger chunks,
> but they don't use it for smaller chunks when you've run out
> of the first 1GB...

This has already been fixed in the latest glibc pre-releases, and the
change will certainly be in glibc-2.1.3. If you are curious, you can
also get the stand-alone ptmalloc release:

    http://www.malloc.de/ptmalloc.tar.gz

which has these changes.

When sbrk() fails (e.g. due to the address space limitations discussed
extensively in this thread), an attempt is now made to create a new
arena in anonymously mmap()ed memory where smaller requests, too, can
be serviced.

Now, where do you all buy those huge amounts of memory ? :-)
(still stuck at 128MB myself...)

Regards,
Wolfram.

-
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/



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:14 EST