Linux-kernel mailing list archive 2000-06,: Re: maximum memory limit

# Re: maximum memory limit

Jakub Jelinek (jakub@redhat.com)
Tue, 8 Feb 2000 16:25:01 +0100

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Tigran Aivazian: "[patch-2.3.43-p2] wrong speed set in drivers/cdrom/mcd.c"
- Previous message: Marco van Tol: "Mount an A-Open DVD drive in slave mode on a HPT366 Controler"

On Tue, Feb 08, 2000 at 03:08:49PM +0100, Rik van Riel wrote:
> On Tue, 8 Feb 2000, Lee Chin wrote:
>
> > Sorry if this is the wrong list, but what is the maximum virtual
> > memory an application can malloc in the latest kernel?
> >
> > Just doing a (for example) "malloc(1024)" in a loop will max out
> > close to 1GB even though I have 4 GB ram on my system.
>
> The kernel supports up to 3GB of address space per process.
> The first 900MB can be allocated by brk() and the rest can
> be allocated by mmap().
>
> Problem is that libc malloc() appears to use brk() only, so
> it is limited to 900MB. You can fix that by doing the brk()
> and malloc() yourself, but I think that in the long run the
> glibc people may want to change their malloc implementation
> so that it automatically supports the full 3GB...

glibc malloc is able to use mmap, plus have a lot of tunable things.
See mallopt(3), particularly M_MMAP_THRESHOLD and M_MMAP_MAX parameters.
The default mmap threshold (above which malloc uses mmap) is I think 128K,
but you can decrease it. But it does not make much sense to decrease this
below PAGE_SIZE, because you then waste a lot of memory.

Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.42 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

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

- Next message: Tigran Aivazian: "[patch-2.3.43-p2] wrong speed set in drivers/cdrom/mcd.c"
- Previous message: Marco van Tol: "Mount an A-Open DVD drive in slave mode on a HPT366 Controler"