Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 1997 19:58:46 -0700
From:      Dave Andersen <angio@angio.net>
To:        Alfred Perlstein <perlsta@cs.sunyit.edu>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: help with fstat? 
Message-ID:  <199710270258.TAA02224@meowy.angio.net>
In-Reply-To: Your message of "Sun, 26 Oct 1997 21:31:01 EST." <Pine.BSF.3.96.971026212719.19711B-100000@server.local.sunyit.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> if i mmap tons of files across many processes i think i will cause a large
> amount of unnessesary paging, as most of the files will be in the
> 200k-5meg range this will be too much laod on the system.

   Nope.  

> 
> unless mmap() maps in on demand... but i think i'll be eating up all my
> address space...

   Pages that you mmap are only paged in on demand.  The simple act of
mmapping a file doesn't cause it to be read in to memory.

   You're not going to eat up your address space with a few mmapped
files per process.  Remember, you're dealing with a 32 bit address
space - you could map in gigabytes per process and not have to worry.

   Remember also that each process has its own virtual address space.
They can't "collide" with each other in some way.  Each process could 
mmap huge chunks and you'd never have to worry.

> isn't fstat supposed to be what i'm looking for?

   Fstat will give you the size of the file, yes.  You'll want to use
it in conjunction with mmap.

> i don't want to exhaust the virtual memory on the machine, just get
> optimal transfers.

   mmap will give you optimal transfers since you won't have the
additional overhead of additional memory copies inside your machine.

   -Dave



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710270258.TAA02224>