From owner-freebsd-hackers Sun Oct 26 18:59:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id SAA08049 for hackers-outgoing; Sun, 26 Oct 1997 18:59:16 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from meowy.angio.net (meowy.angio.net [206.197.119.31]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id SAA08042 for ; Sun, 26 Oct 1997 18:59:13 -0800 (PST) (envelope-from angio@meowy.angio.net) Received: from meowy.angio.net (localhost.angio.net [127.0.0.1]) by meowy.angio.net (8.8.7/8.7.3) with ESMTP id TAA02224; Sun, 26 Oct 1997 19:58:47 -0700 (MST) Message-Id: <199710270258.TAA02224@meowy.angio.net> To: Alfred Perlstein cc: hackers@FreeBSD.ORG Subject: Re: help with fstat? In-reply-to: Your message of "Sun, 26 Oct 1997 21:31:01 EST." Date: Sun, 26 Oct 1997 19:58:46 -0700 From: Dave Andersen Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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