From owner-freebsd-hackers Mon Oct 27 10:18:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id KAA11682 for hackers-outgoing; Mon, 27 Oct 1997 10:18:52 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.5.85]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id KAA11674 for ; Mon, 27 Oct 1997 10:18:45 -0800 (PST) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.7/8.8.7) id LAA14904; Mon, 27 Oct 1997 11:16:06 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp04.primenet.com, id smtpd014899; Mon Oct 27 11:16:02 1997 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id LAA23283; Mon, 27 Oct 1997 11:15:56 -0700 (MST) From: Terry Lambert Message-Id: <199710271815.LAA23283@usr04.primenet.com> Subject: Re: help with fstat? To: angio@angio.net (Dave Andersen) Date: Mon, 27 Oct 1997 18:15:56 +0000 (GMT) Cc: perlsta@cs.sunyit.edu, hackers@FreeBSD.ORG In-Reply-To: <199710270258.TAA02224@meowy.angio.net> from "Dave Andersen" at Oct 26, 97 07:58:46 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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. Except if you linearly traverse the mapped file, and it's a big file. Then it will force almost all other clean pages out of core via LRU. So you can thrash the paging algorithm this way. But you can also thrash it (albiet less quickly) using reads. There used to be a MAP_SEQUENTIAL flag to get it to discard buffers after they had been accesed, instead of forcing more pages off the LRU, but BSD doesn't support this. 8-(. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.