On Sat, Jan 25, 2003 at 06:18:47AM -0800, Sean O'Rourke wrote:
> On Sat, 25 Jan 2003, Leopold Toetsch wrote:
> > Dan Sugalski wrote:
> >
> > > At 5:32 PM +0000 1/24/03, Dave Mitchell wrote:
> > >
> > >> I just wrote a quick C program that successfully mmap-ed in all 1639
> > >> files in my Linux box's /usr/share/man/man1 directory.
> > >
> > >
> > > Linux is not the universe, though.
> 
> How true.  On Solaris, for example, mmap's are aligned on 64k boundaries,
> which leads to horrible virtual address space consumption when you map
> lots of small things.  If we're mmap()ing things, we want to be sure
> they're fairly large.

Okay, I just ran a program on a a Solaris machines that mmaps in each
of 571 man files 20 times (a total of 11420 mmaps). The process size
was 181Mb, but the total system swap available only decreased by 1.2Mb
(since files mmapped in RO effecctively don't consume swap).

I think Solaris and Linux can both cut this. If other OSes can't, then
we fallback to reading in the file when necessary.

-- 
Lady Nancy Astor: If you were my husband, I would flavour your coffee
with poison.
Churchill: Madam - if I were your husband, I would drink it.

Reply via email to