Re: Naive Windows VM paging algorithm - is Linux better?
From: Floyd Davidson (floyd_at_barrow.com)
Date: 09/13/03
- Next message: raffelm: "Soulblighter game question"
- Previous message: Dave Uhring: "Re: Protecting executables from viruses?"
- In reply to: Kirk Strauser: "Re: Naive Windows VM paging algorithm - is Linux better?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 12 Sep 2003 15:26:07 -0800
Kirk Strauser <kirk@strauser.com> wrote:
>At 2003-09-12T16:45:45Z, Floyd Davidson <floyd@barrow.com> writes:
>
>> His suggestion has no merit. Running processes are not paged out unless
>> the system is in need of RAM. The solution then is to purchase RAM, not
>> to hog tie the VM system.
>
>Are you sure of that? I'm almost positive that FreeBSD pages out unused
>code pages, and I was pretty sure that Linux did this too.
Yes, but no not as you might think.
Linux (and as far as I know FreeBSD too) will attempt to keep
running processes fully in memory. That can be done when there
is sufficient RAM (for example, enough to use as a disk cache),
but of course might not be able to be done if RAM is used up by
running processes and paging is necessary to continue running
all processes. (Of course, if that happens your box is running
like molasses in January on the Arctic Ocean, which I assure you
is slow.) Hence the reason to buy more RAM.
There are also other optimizations. If the cache hit rate is
slow it makes more sense to reduce the cache size than it does
to flush idle processes to swap. Take, for example, the case
where a backup is being done, and every file is being read in...
but only once. On the other hand if the cache hit rate is high
it makes sense to increase the cache size and free up memory to
do so by flushing long sleeping processes to swap. And example
would be when repeated compiles of the kernel are being done.
That is one reason we can't say it takes x hours for an idle
process to be swapped out. It depends on what the system is
doing as to whether idle processes will be swapped at any given
time. And the cache itself is managed in a complex way too,
because data that is read in and then never accessed is treated
very differently from data that gets several hits and then
enters a long period with no hits.
Note that the effort to keep running processes in RAM is most
useful to servers, and less useful on a workstation, while
the relationship between cache hits to swap activity is more
important to workstations that to servers.
-- Floyd L. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik (Barrow, Alaska) floyd@barrow.com
- Next message: raffelm: "Soulblighter game question"
- Previous message: Dave Uhring: "Re: Protecting executables from viruses?"
- In reply to: Kirk Strauser: "Re: Naive Windows VM paging algorithm - is Linux better?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|