Using Virtual Memory

NetWare provides a virtual memory system that moves data out of memory and into a swap file on disk if the data isn't used frequently. Thus, the virtual memory system ensures that RAM is used more efficiently. It lessens the likelihood that low memory conditions will cause an abend.

For general information about virtual memory, see Virtual Memory.

You can manage the swapping of data by controlling the swap files where the data is stored on disk. Use the following commands to create, delete, and manage swap files.

To...

At the server console prompt, enter...

Learn about the SWAP command

HELP SWAP

Display a Virtual Memory Information Screen containing information about swap files

SWAP

Alternatively, see MONITOR > Available Options > Virtual Memory > Swap Files.

Create a swap file on a designated volume.

SWAP ADD volume_name [parameter= value...]

Optional parameters are MIN=, MAX=, and MIN FREE=. These parameters specify minimum and maximum size of the swap file and the minimum free space that must be left on the volume. Values are in millions of bytes.

If parameters are not included, default values are used:

MIN = 2

MAX = Free volume space

MIN FREE = 5

Delete a swap file from a designated volume

SWAP DEL volume_name

If you are using protected address spaces, the Java Virtual Machine, or any other application that uses virtual memory, be sure to keep at least one swap file.

If the swap file is being used when it is deleted, then the swapped data is moved to another swap file. If there is no other swap file, an error message is displayed and the file is not deleted.

By default, a swap file is created on the Sys volume. If you do not want a swap file on Sys, place the SWAP DEL command in the startup.ncf file before the command to mount volumes.

Change the parameter values for a swap file on a designated volume

SWAP PARAMETER volume_name parameter=value...

Parameters are MIN=, MAX=, and MIN FREE=. These parameters specify the minimum and maximum size of the swap file and the minimum free space that must be left on the volume. Values are in millions of bytes.

Specify the point at which the server sends an alert to the console because of excessive memory swapping.

SET AVERAGE PAGE IN ALERT THRESHOLD = value

The value is the average number of pages swapped from disk to memory per second, calculated over the last five seconds. The default is 2000.

If the average page-in rate is high, it means a large amount of data is being swapped to and from disk, indicating that the server might be running low on memory.

You can also set the parameter from MONITOR > Available Options > Server Parameters > Memory.


Using Swap Files


Responding to Disk Thrashing

If the overall supply of memory is running low, then swapping will occur more often. If memory is extremely low, the system may spend all its time swapping memory in and out of disk and have no time to accomplish useful work. This is called disk thrashing.

In extremely low memory conditions, NetWare will move all the data from a protected address space into the disk swap file, temporarily stopping the modules within the space. After a period of time, NetWare will move the data back into the memory space and shut down another space, moving its data to disk. Without virtual memory, these extremely low memory conditions would cause processes to fail. With virtual memory, the server keeps running, although very slowly.

When disk thrashing occurs, the solution is to add more RAM. Virtual memory cannot compensate for an overall lack of server memory, although it can prevent processes from failing and allow a server to continue to function.

The real value of virtual memory is in using a sufficient supply of memory more efficiently, thus improving server performance.