From owner-freebsd-questions Fri Nov 19 13:59:26 1999 Delivered-To: freebsd-questions@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 89A4414DE9 for ; Fri, 19 Nov 1999 13:59:15 -0800 (PST) (envelope-from dg@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id NAA01939; Fri, 19 Nov 1999 13:57:53 -0800 (PST) Message-Id: <199911192157.NAA01939@implode.root.com> To: Jonathon McKitrick Cc: Lowell Gilbert , freebsd-questions@FreeBSD.ORG Subject: Re: Memory Info In-reply-to: Your message of "Fri, 19 Nov 1999 20:01:32 GMT." From: David Greenman Reply-To: dg@root.com Date: Fri, 19 Nov 1999 13:57:53 -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >On Fri, 19 Nov 1999, Lowell Gilbert wrote: > >>>If this is the case, does this mean FreeBSD keeps everything possible in >>>memory and then swaps out to VM when it needs more? >> >>This is a badly-worded question -- that, in itself, indicates some of what >>you're missing. VM *is* memory; the 'M' *stands* for the word "memory." > >OK, i meant swaps it to _disk_ here... > >>Specifically, VM is an abstraction of memory space that allows parts of >>that space to be kept in different kinds of storage at any particular > >>That's only a rough approximation, though. Pages can get swapped to disk >>well before they're needed for other purposes, and then there's no wait on >>the disk write before they can be re-used. They don't have to be cleared >>immediately, though, so if the original task accesses the page before it's >>needed for anything else, that page is still in RAM (and the swap copy of >>the page is invalidated). > >If pages are swapped to disk before they are needed, then there *IS* a >wait on the disk write before the can be re-used, correct? FreeBSD only has to preserve pages that are dirty. The data in pages that is brought in from files (such as when doing normal file reads) can just be discarded if the page hasn't been modified. In an effort to minimize swap I/O, FreeBSD generally favors clean pages over dirty ones when deciding what pages to reclaim. The page priority algorithm is actually quite complicated, however, and defies any simplistic explaination that could be made in an email. -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project - http://www.freebsd.org Creator of high-performance Internet servers - http://www.terasolutions.com Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message