linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Rik van Riel <riel@nl.linux.org>
Cc: Lee Chin <leechin@mail.com>,
	Linux Kernel <linux-kernel@vger.rutgers.edu>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: maximum memory limit
Date: Tue, 8 Feb 2000 16:25:01 +0100	[thread overview]
Message-ID: <20000208162501.I532@mff.cuni.cz> (raw)
In-Reply-To: <Pine.LNX.4.10.10002081506290.626-100000@mirkwood.dummy.home>; from Rik van Riel on Tue, Feb 08, 2000 at 03:08:49PM +0100

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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

  parent reply	other threads:[~2000-02-08 15:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <381740616.949993193648.JavaMail.root@web36.pub01>
2000-02-08 14:08 ` Rik van Riel
2000-02-08 14:48   ` Matthew Kirkwood
2000-02-08 15:04   ` Mark Hahn
2000-02-08 15:25   ` Jakub Jelinek [this message]
2000-02-08 16:13   ` Rogier Wolff
2000-02-08 16:25   ` Eric W. Biederman
2000-07-02  5:35   ` Raymond Nijssen
2000-07-03 10:35     ` Stephen C. Tweedie
2000-07-03 13:32       ` Jamie Lokier
2000-07-03 14:18         ` Stephen C. Tweedie
2000-07-03 15:01           ` Jamie Lokier
2000-07-03 19:32       ` Raymond Nijssen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000208162501.I532@mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=leechin@mail.com \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=riel@nl.linux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox