4.5 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 but with slower overall performance. It lessens the likelihood that low memory conditions will cause a problem with the server. For general information about virtual memory, see Virtual Memory.

One of the most important things you can do to allocate memory is to set the VM Cache Pool Percentage correctly. If you are running on a system with many applications running in protected mode or with many Java applications, set the percentage high. If you are not running in these two conditions, the VM Cache Pool Percentage doesn't matter.

Novell Remote Manager has several pages that can assist you in monitoring and managing the use of the virtual memory system in your server:

Table 4-1 Tasks and Procedures for Managing Memory by Using Novell Remote Manager

To

Do the Following

View the overall performance of the virtual memory system

  1. Click Health Monitor under the Diagnose Server heading in the navigation frame.

  2. Click Virtual Memory Performance in the Server Health table.

  3. View the Virtual Memory Health Information page.

View specific performance of the virtual memory system

  1. Click View Memory Config under the Manage Server heading in the navigation frame.

  2. Click Virtual Memory System on the View Memory Config page.

  3. Click To Virtual Memory Cache Pool to view the statistics for each cache pool type. (For information on each type of statistic listed, see the online help.)

  4. Click To Virtual Memory Statistics to view the following statistics: Current Available Memory, Free Desired Pages, Free Lots Pages, Free Minimum Pages, Memory Available State, Need Free Clean Pages, Need Free Pages, and Upper Page I/O Threshold. (For information on each type of statistic listed, see the online help.)

Change SET parameters associated with the virtual memory system

  1. Click Set Parameters under the Manage Server heading in the navigation frame.

  2. Click Memory in the Category Name table on the Set Parameters page.

  3. Click the value link for each specific virtual memory parameter you want to change.

  4. Type the new value in the Current Value field, then click OK.

4.5.1 Using Swap Files

You can manage the swapping of data by controlling the swap files where the data is stored on disk.

You can create one swap file per volume. The swap file for volume sys: is created by default; you can delete it if necessary or move it to another volume.

Data moved to disk by virtual memory is stored in any available swap file; it does not matter which volume the swap file is on. Generally, you should place swap files on the fastest volume, the one with the most available space, or the one that is used the least.

You can add a swap file to a volume that is not mounted. The file is created when you mount the volume. When you dismount a volume, the swap file is deleted.

To keep a swap file on that volume, you must create the swap file again when the volume is mounted. The exception is the swap file for volume sys:, which is created by default.

Swap files are dynamic; they expand and contract as data is swapped in and out of memory.

To create, delete, and manage swap files, access NW 6.5 SP8: Novell Remote Manager Administration Guide and complete the tasks in the following table:

Table 4-2 Tasks and Procedures for Managing Swap File by Using Novell Remote Manager

To

Do the Following

Learn about the swap command

  1. Click Console Commands under the Manage Server heading in the navigation frame.

  2. Click SWAP Info on the Console Commands page.

Display the Swap File Information page

  1. Click View Memory Config under the Manage Server heading in the navigation frame.

  2. Click Virtual Memory System > To Swap File Information.

Create a swap file on a designated volume

  1. Click View Memory Config under the Manage Server heading in the navigation frame.

  2. Click Virtual Memory System > To Swap File Information.

  3. Click the value link in the Swapping Enabled column for the volume you want to enable.

  4. (Optional) Type the values you want in the Minimum Reserved, Maximum Used for Swapping, and Minimum Volume Free Space fields. (These parameters specify minimum and maximum size of the swap file and the minimum free space that must be left on the volume.)

  5. On the Enable Swapping page, click Enable.

  6. If the file is not on volume sys:, add the commands to create swap files to the autoexec.ncf file so the files are created each time the server is started.

  • The command syntax is swap add volume_name [parameter=value...]
  • Optional parameters are min, max, and min free.
  • For example:
  • swap add vol1 min=3, max=6, min free=2000

Delete a swap file from a designated volume

  1. Click View Memory Config under the Manage Server heading in the navigation frame.

  2. Click Virtual Memory System > To Swap File Information.

  3. Click the value link in the Swapping Enabled column for the volume you want to delete the swap file from.

  4. On the Disable Swapping page, click Disable.

IMPORTANT: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 and there is not enough physical memory to move all the swapped data, an error message is displayed and the file is not deleted.

By default, a swap file is created on volume sys:. If you do not want a swap file on volume sys:, place the swap del sys command in the startup.ncf file.

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

  1. Click View Memory Config under the Manage Server heading in the navigation frame.

  2. Click Virtual Memory System > To Swap File Information.

  3. Click the link for the value you want to change.

  4. On the Change Swap Parameters page, specify the new values you want and then click Change.

4.5.2 Responding to Disk Thrashing

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

If the overall supply of memory is running low, then swapping will occur more often when virtual memory is in use. If memory is extremely low, the system might spend a significant amount of its time swapping memory in and out of disk and have little time to accomplish useful work. This is called disk thrashing.

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

If the Average Clean Free Available state or the Average Page I/O state is Suspect or Bad on the Virtual Memory Health Information page in Novell Remote Manager, your server is experiencing disk thrashing.

The best way to prevent disk thrashing is to control how much memory is used by the virtual memory system. Set the VM Cache Pool Percentage parameter to a percentage between 0 to 90.

If you set it to more than the virtual memory system needs, it is harmless because the virtual memory system will not take it. But if you set it to less than the virtual memory system needs, you will create disk thrashing.

To set the VM Cache Pool Percentage in Novell Remote Manager:

  1. Click Set Parameters under the Manage Server heading in the navigation frame.

  2. Under Set Parameter Control, set View Hidden Set Parameters to On.

  3. Under Category Name, click Memory > VM Cache Pool Percentage.

  4. In the Current Value field, type the new value, then click OK.

If your server is experiencing disk thrashing, you can also use the following two hidden set parameters (Memory category) to manage the balance between the virtual memory cache pool and the file system cache pool:

  • VM Cache Pool Free Desired Pages

    Range 0 to 2147483647, Default: 256

    This parameter specifies the number of pages that the virtual memory system cache needs to operate properly.

  • VM Cache Pool Free Lots of Pages

    Range: 0 to 2147483647, Default: 512

    This parameter specifies the number of pages that the virtual memory system cache considers to be excessive. Having an available page count higher than this number might result in the pages being be given to another cache pool.

You can specify the point at which the server sends an alert to the console because of excessive memory swapping by using the Average Page In Alert Threshold SET parameter (Memory category).

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.

To change the values for this parameter using Novell Remote Manager:

  1. Click Set Parameters under the Manage Server heading in the navigation frame, then click Memory in the Category Name table on the Set Parameters page.

  2. Click the value link for the Average Page in Alert Threshold setting.

  3. Type the new value in the Current Value field, then click OK.

When disk thrashing occurs, the complete 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.