summaryrefslogtreecommitdiff
path: root/sag-0.6.1-www/Invisible/sag-0.6/node60.html
blob: 39ad118c67258042adc6a994d8ec81834c1f3df8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<!--Converted with LaTeX2HTML 96.1-h (September 30, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
<HTML>
<HEAD>
<TITLE>What is virtual memory?</TITLE>
<META NAME="description" CONTENT="What is virtual memory?">
<META NAME="keywords" CONTENT="sag">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<LINK REL=STYLESHEET HREF="sag.css">
</HEAD>
<BODY LANG="EN" >
 <A NAME="tex2html1070" HREF="node61.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1068" HREF="node59.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1062" HREF="node59.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1072" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1073" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1071" HREF="node61.html">Creating a swap space</A>
<B>Up:</B> <A NAME="tex2html1069" HREF="node59.html">Memory Management</A>
<B> Previous:</B> <A NAME="tex2html1063" HREF="node59.html">Memory Management</A>
<BR> <P>
<H1><A NAME="SECTION00610000000000000000">What is virtual memory?</A></H1>
<P>
	Linux supports <b>virtual memory</b>, that is, using a 
	disk as an extension of RAM so that the effective size of
	usable memory grows correspondingly.  The kernel will write
	the contents of a currently unused block of memory to the
	hard disk so that the memory can be used for another purpose.
	When the original contents are needed again, they are read
	back into memory.  This is
	all made completely transparent to the user; programs running under
	Linux only see the larger amount of memory available and
	don't notice that parts of them reside on the disk from
	time to time.  Of course, reading and writing the hard disk is
	slower (on the order of a thousand times slower) than using
	real memory, so the programs don't run as fast.  The part of
	the hard disk that is used as virtual memory
	is called the <b>swap space</b>.
<P>
	Linux can use either a normal file in the filesystem or a
	separate partition for swap space.  A swap partition is
	faster, but it is easier to change the size of a swap file
	(there's no need to repartition the whole hard disk, and
	possibly install everything from scratch).  When you know how
	much swap space you need, you should go for a swap partition,
	but if you are uncertain, you can use a swap file first, use
	the system for a while so that you can get a feel for how much
	swap you need, and then make a swap partition when you're
	confident about its size.
<P>
	You should also know that Linux allows one to use several swap
	partitions and/or swap files at the same time.  This means
	that if you only occasionally need an unusual amount of swap space,
	you can set up an extra swap file at such times, instead of
	keeping the whole amount allocated all the time.
<P>
	A note on operating system terminology: computer science usually
	distinguishes between swapping (writing the whole process out to
	swap space) and paging (writing only fixed size parts, usually
	a few kilobytes, at a time). Paging is usually more efficient,
	and that's what Linux does, but traditional Linux terminology
	talks about swapping anyway.<A NAME="tex2html26" HREF="footnode.html#1820"><IMG  ALIGN=BOTTOM ALT="gif" SRC="./foot_motif.gif"></A>
<P>
<HR><A NAME="tex2html1070" HREF="node61.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="./next_motif.gif"></A> <A NAME="tex2html1068" HREF="node59.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="./up_motif.gif"></A> <A NAME="tex2html1062" HREF="node59.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="./previous_motif.gif"></A> <A NAME="tex2html1072" HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="./contents_motif.gif"></A> <A NAME="tex2html1073" HREF="node114.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="./index_motif.gif"></A> <BR>
<B> Next:</B> <A NAME="tex2html1071" HREF="node61.html">Creating a swap space</A>
<B>Up:</B> <A NAME="tex2html1069" HREF="node59.html">Memory Management</A>
<B> Previous:</B> <A NAME="tex2html1063" HREF="node59.html">Memory Management</A>
<P><ADDRESS>
<I>Lars Wirzenius <BR>
Sat Nov 15 02:32:11 EET 1997</I>
</ADDRESS>
</BODY>
</HTML>