[1861] in RedHat Linux List
Swapping scheme
daemon@ATHENA.MIT.EDU (William T Wilson)
Wed Oct 30 13:45:09 1996
Date: Wed, 30 Oct 1996 13:38:55 -0500 (EST)
From: William T Wilson <fluffy@benatar.res.cmu.edu>
To: redhat-list@redhat.com
In-Reply-To: <199610301731.MAA15525@redhat.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Ariel Mazzarelli wrote:
> I believe the various MS (again, I'm not sure which or if any apply)
> OSes use a different swapping scheme. Linux uses demand paging, where I
> believe Windows uses (dammit I can't rember the name) swapping... the
> basic difference is that Linux can swap parts of a program, where
> Windows* have to swap the entire application in and out of memory.
Both Linux and Windows can swap portions of an application in and out of
memory (the nature of the x86 CPU is that swapping is done in 4K blocks).
Otherwise, Windows would not be able to swap because no program could run
at all if it were swapped out. Linux is just more selective about what
gets swapped. Since program code doesn't change, Linux never writes it to
disk. Instead, if program code is scheduled for swapping out, Linux just
throws it away and reloads it from the original executable when it's
needed; only data is ever actually written to swap. This saves swap space
and cuts down on time-consuming disk writes. This isn't demand paging,
although it is related.
Under demand paging, Linux only loads the portions of a program that are
actually used. When an executable is run, Linux only actually loads the
first 4K of it... the rest is left on disk until it's needed. This means
that programs can start executing before they're finished loading, and it
also cuts down on memory usage. Linux can do this because all its
applications are full 32-bit; Windows is hobbled by the need to support
16-bit software, which won't work this way (that I know of).
Also keep in mind that the Linux kernel is much smaller than any Windows
kernel (although X-server processes can take up plenty of RAM to make up
for that), and that the extensive use of shared libraries also saves
memory. Therefore, Linux simply requires less memory in the first place,
which cuts down on memory bottlenecks in the first place.
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null