From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: "Mouawad, Tony" <Tony.Mouawad@christiedigital.com>
Cc: "Robert Hancock" <hancockr@shaw.ca>, <linux-kernel@vger.kernel.org>
Subject: Re: Help Understanding Linux memory management
Date: Tue, 10 Apr 2007 17:16:31 +0100 [thread overview]
Message-ID: <20070410171631.4844afe8@the-village.bc.nu> (raw)
In-Reply-To: <AD98412A5373CC4AA643D9C021922A541C4DC8@cdskitexg01.cds.int>
On Tue, 10 Apr 2007 10:31:34 -0400
"Mouawad, Tony" <Tony.Mouawad@christiedigital.com> wrote:
> When vm.overcommit_memory = 2 and there appears to be about 2M of memory
> readily available and about 12M of memory allocated to pagecache (this
> is info gathered from /proc/meminfo) , a call to malloc(5000000) returns
> NULL. I would have expected that somehow, the call to malloc(5000000)
> would request the memory in pagecache to be released for use by the app.
That can only be done if the memory in the page cache is not being used.
In a system with swap it is possible for anonymous pages to be pushed to
disk, on a system without swap only unchanged disk mapped pages such as
executable progam pages (some of them anyway) can be thrown out if they
are still in use.
More importantly overcommit is address *space* not pages. It deals with
the theoretical worst cases and ensure that a page write won't cause an
out of memory situation. That means it is more pessimistic than the usual
workload. It also by default allows lots of room for worst case kernel
behaviour that is appropriate to a real system with swap but not embedded
so you may well want to tune that via the overcommit ratio proc interface
Alan
next prev parent reply other threads:[~2007-04-10 16:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.jFpt5NWxHc2YH0jy7hPsDxyUr0E@ifi.uio.no>
2007-04-10 14:15 ` Robert Hancock
2007-04-10 14:31 ` Mouawad, Tony
2007-04-10 16:16 ` Alan Cox [this message]
2007-04-10 18:17 ` Mouawad, Tony
2007-04-10 13:51 Mouawad, Tony
2007-04-10 14:22 ` Laurent Pinchart
2007-04-12 0:23 ` David Schwartz
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=20070410171631.4844afe8@the-village.bc.nu \
--to=alan@lxorguk.ukuu.org.uk \
--cc=Tony.Mouawad@christiedigital.com \
--cc=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®