Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Nov 1999 15:25:36 -0500 (EST)
From:      Lowell Gilbert <lowell@world.std.com>
To:        jcm@dogma.freebsd-uk.eu.org
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Memory Info
Message-ID:  <199911192025.PAA15070@world.std.com>
In-Reply-To: <Pine.BSF.4.02A.9911191956100.28523-100000@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Sorry about the empty message.  I think I fixed the headers this time...

>Date: Fri, 19 Nov 1999 20:01:32 +0000 (GMT)
>From: Jonathon McKitrick <jcm@dogma.freebsd-uk.eu.org>
>
>On Fri, 19 Nov 1999, Lowell Gilbert wrote:
>
>>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?

Yes.  To avoid needing to wait before giving memory to a task that needs
more, the system maintains a small pool of pages that have already been
zeroed.  This is the only *really* free RAM in the system.  It's what you
see as "free" in the output of top(1).

>>>                                                     How are unnecessary
>>>page faults and disk accesses avoided with this method?
>>
>>Quite well.  A RAM page is never assigned to a new use unless that that
>>use *needed* RAM.  [I realize I'm being a little disinguous here; the
>>problem is not when to reassign a page, but which one to reassign.  Making
>>that guess is a rather complicated statistical problem, but amounts to
>>guessing which current page is least likely to be needed again soon.]
>
>FIFO, LRU, Second Chance, etc.
>And i don't quite understand that second sentences.. typo, maybe?

No.  I used "use" as a noun, not a verb.  Replace it with "task" if you
prefer, although tasks aren't really the only things that can use memory.
The point I was making is that from one point of view, a page fault is
*never* unnecessary; it only happens because something needed the memory.

>I didn't realize body language could cause such a misinterpretation of
>email.  ;-)

It doesn't always, but it can help.  In this case, it would've stopped me
when you got confused about the part of speech for "use."  Unfortunately,
I'm American and thus you might consider me handicapped at communicating
in "English."  [Joking aside, I actually scored *very* high on it on my
'O' levels.  I'm not kidding about being American, though.]

Be well.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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