Re: mmap

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sun, 31 May 1998 01:06:19 +0200

--MimeMultipartBoundary
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Stephen R. van den Berg wrote:

> I fail to see why this should be the natural conclusion.
> mmap()ing files basically *always* saves memory and therefore reduces
> net disk activity (which is what it is all about, we don't care if we
> page, or swap, or read/write files; all we care about is that we want
> to minimise disk activity, and minimise the total memory required).

mmap()ing does not automatically save memory. It very much depends on
how you use mmap(). And in this case the savings you speak about is only
8K per open file (the user-side I/O buffer). The rest is a design issue
(keep a hot object cache or not).

> Depending on your definition of VM paging, I think you could say that
> all OSes do this, I suppose.

Some OS:es make a big difference in file I/O (read/write) or VM, giving
VM usage a much higher priority for physial memory pages than file I/O
(or have a limited memory pools for file I/O), and thereby tries to keep
the programs in memory even when there is heavy I/O.

Others uses different access timers for different kinds of pages to
achive similar results.

Some OS:es don't, makeing code and I/O compete about physical memory.

/Henrik

--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:50 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:48 MST