Swap space, that is, virtual memory in the operating system. This article briefly introduces some basic commands for swap space management.
Swap space allocation principles:
Only one paging space per disk;
Use disks with the least activity;
Paging spaces roughly the same size;
Do not extend paging space to multiple physical volumes;
Use multiple disk controllers;
View swap space usage:
# LSPs-
Page Space
Physical Volume
Volume Group
Size % used active
Auto
Type
Paging00
Hdisk4
Rootvg
8192 MB
31
Yes
Yes
LV
Hd6
Hdisk3
Rootvg
8192 MB
31
Yes
Yes
LV
View the number of physical memory:
# Lsattr-El sys0-A realmem
Realmem 33554432 amount of usable physical memory in Kbytes false
Or:
# Lsattr-El mem0
Goodsize 32768 amount of usable physical memory in Mbytes false
Size
32768 total amount of physical memory in Mbytes
False
View the swap space activated when the system starts:
# Cat/etc/swapspaces
*/Etc/swapspaces
*
* This file lists all the paging spaces that are automatically put
* Service on each system restart (the 'swapon-a' command executed from
*/Etc/rc swaps on every device listed here ).
*
* Warning: Only paging Space Devices shoshould be listed here.
*
* This file is modified by the CHPs, mkps and RMPs commands and referenced
* By the LSPs and Swapon commands.
Hd6:
Dev =/dev/hd6
Paging00:
Dev =/dev/paging00
Pay special attention to the following information. Once discovered, the system administrator should be notified immediately for handling:
"Init: Paging space is low"
"KSh: cannot fork no swap space"
"Not enough memory"
"Fork function failed"
"Fork () System Call failed"
"Unable to fork, too may processes"
"Fork failure-not enough memory available"
"Fork function not allowed. Not enough memory available ."
"Cannot fork: not enough space"
You can use
Smit
Or
Mkps
Command to complete,
Mkps
The command format is as follows:
Mkps [-A] [-N] [-T type]-s numlps vgname pvname
Vgname
The volume group (
Volume Group
) Name
Pvname
The physical volume of the swap space (
Physical Volume
) Name
-S numlps
The logical partition occupied by the swap space (
Logical Partition
)
-
Activate the anti-bot service when the system starts the next time.
(
Add the swap space
/Etc/swapspaces
File
)
-N
Activate the swap space now
-T Type
Specify the type of the swap space (
LV
Or
NFS
)
The following command is named
Rootvg
Volume Group
(
Volume Group
)
Create
4
Logical partitions
(
Logical Partition
)
The size of the swap space. Activate the swap space immediately after creation and activate the swap space the next time the system starts:
# Mkps-S 4-n-A rootvg
After the command is executed
/Dev/pagingnn
A swap space, where
Nn
Is a sequence number, such
00
,
01
.
If the swap space is not activated when it is created, use the following command to activate it:
# Swapon
/Dev/paging00
Swap-
Command can be activated
/Etc/swapspaces
All swap spaces defined in. This command is generally automatically executed when the system starts.
The following command changes an activated swap space to inactive:
# Swapoff
/Dev/paging00
This command may be caused
I/O
Error or insufficient swap space
Paging00
Failed.
You can use the following command to dynamically modify the size of a swap space:
# CHPs-D 1 paging00
#
From swap space
Paging00
Deleting
1
Items
Lp
;
# CHPs-S 1 paging00
#
To swap space
Paging00
Add
1
Items
Lp
;
Note: This command cannot make the primary swap space (usually
Hd6
)
Less than 32 MB.
The following command can be used to delete a swap space:
# RMPs paging00
Before deleting a swap space, the swap space must be inactive.