Sie sind auf Seite 1von 2

United States-English

Search:
More options
» Contact HP
Manual Technical documentation - English All of HP US
HP-UX System Administration Tasks: HP 9000 > Chapter 6 Managing Swap Space and Dump Areas

What is Swap Space?

» Technical » Table of Contents » Index


documentation
« prev next »
Complete book in PDF

» Feedback Phy sical memory is a f inite resource on a computer sy stem. Only so many processes can f it in
phy sical memory at any one time, though many more may actually be ready to run or execute.
Swapping and paging algorithms allow processes or portions of processes to mov e between phy sical
memory and a mass storage dev ice. This f rees up space in phy sical memory .

Swap space is an area on disk that temporarily holds a process memory image. When phy sical
memory demand is suf f iciently low, process memory images are brought back into phy sical
memory f rom the swap area on disk. Hav ing suf f icient swap space enables the sy stem to keep
some phy sical memory f ree at all times.

This ty pe of memory management is of ten ref erred to as virtual memory and allows the total
number of processes to exceed phy sical memory . Virtual memory enables the execution of a
process within phy sical memory only as needed.

Prior to the 10.0 release, processes not currently needed were "swapped out". When a process is
swapped, all the units associated with the process (called pages) are sent to disk storage in one
single transf er. This can cause the computer to spend quite a lot of time perf orming I/O transf ers
instead of running applications. Beginning with 10.0, this mechanism has been replaced by a
deactivation mechanism whereby a process is taken of f the run queue and its pages are mov ed
to disk storage over time by the pager instead of all in one single transf er. When a process is not
being executed, memory becomes more readily av ailable f or use by other processes.

Y ou should note that although processes are no longer swapped, we will continue to ref er to this
storage as swap space. This is because the term is currently widely used and its def inition well
understood by users.

This chapter explains how to manage y our sy stem's swap space, including determining how much
and what ty pe of swap space the sy stem needs, and how to add or remov e swap space as the
sy stem's needs change.

Types of Swap Space

There are three ty pes of swap space: dev ice swap, f ile sy stem swap, and pseudo-swap space.
Each is used dif f erently by the sy stem and has its own adv antages and disadv antages.

Device Swap

Swap space is initially allocated when y ou conf igure y our disks. Device swap space occupies a
logical v olume or partition, which is ty pically reserv ed expressly f or swapping purposes. This space
may also be conf igured as a dump area (see "Setting Up Dump Areas" later in this chapter).

Dev ice swap can only be used locally ; dev ice swap cannot be accessed remotely by clients using
NFS.

Dev ice swap space is quickly accessed because the operating sy stem can get to the logical
v olume or partition directly to perf orm large I/Os.

File System Swap


Y ou can additionally use av ailable space in a f ile sy stem f or swap space. Setting up such file
system swap space allows f or extra swap if there is occasional need f or more than the allocated
dev ice swap space. It is used only when dev ice swap space is insuf f icient.

When y our sy stem needs extra swap space, f ile sy stem swap allows y ou to use existing f ile
sy stem space rather than reserv ing an entire dedicated logical v olume or partition. Howev er,
because f ile sy stem swap requires the sy stem to perf orm a greater amount of processing and is
usually slower than dev ice swap, it should not be used as a permanent replacement f or a suf f icient
amount of dev ice swap space.

The f ile sy stem used f or swap can be either a local or a remote f ile sy stem. Cluster clients can use
remote f ile sy stem swap f or their swap needs. (See Chapter 11, "Setting Up and Administering an
HP-UX NFS Diskless Cluster" f or inf ormation on cluster clients.) Swapping to a remote f ile sy stem
is slower than swapping to a local f ile sy stem and is not encouraged if local dev ice swap or local f ile
sy stem swap is av ailable.

Pseudo-Swap

Pseudo-swap space allows f or the use of sy stem memory as a third ty pe of swap space. That is,
HP-UX swap space can also consist of up to sev en-eighths (87.5%) of sy stem memory capacity .

For example, a computer with one GB of sy stem memory and one GB of dev ice and f ile sy stem
swap, can run up to 1.87 GB of processes. If any process attempts to grow or be created bey ond
this extended threshold, the process will f ail.

When using pseudo-swap, since more processes can be created, the sy stem load increases,
causing more paging and deactiv ation activ ity .

By def ault, pseudo-swap space is conf igured to be av ailable. If y ou do not wish to make use of it,
y ou will need to re-set the tunable sy stem parameter, swapmem_on, to 0 ("of f "). (To modif y a
conf igurable parameter, see "Making Adjustments to Y our Sy stem" in Chapter 1.)

Primary and Secondary Swap

Y our sy stem must hav e at least one dev ice swap area av ailable when it boots. This area is known
as the primary swap area. (Primary swap is not mandatory if pseudo-swap is enabled, howev er, it
is strongly recommended.) Primary swap, by def ault, is located on the same disk as the root f ile
sy stem. By def ault, the sy stem's kernel conf iguration f ile /stand/system contains the
conf iguration inf ormation f or primary swap.

Other swap may be used in addition to primary swap. Such swap is ref erred to as secondary swap.
If y ou are using dev ice swap as secondary swap, allocate such secondary swap to reside on a disk
other than the root disk f or better perf ormance. File sy stem swap is alway s secondary swap.

« prev next »

What Tasks Will I Find in This Chapter? Designing Y our Swap Space Allocation

Printable version

Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.

Das könnte Ihnen auch gefallen