Visit Azul.com Support

SWAP Settings

Table of Contents

Looking for Zing? The Azul Zing Virtual Machine is now Azul Zulu Prime Builds of OpenJDK and part of Azul Platform Prime. Learn more.

Ensure your SWAP is either turned off or set to 0. Add the required parameter to the sysctl.conf file. A common method used to change the parameter value is to edit /etc/sysctl.conf then use the sysctl command to write the changes into the kernel. This ensures the swap setting is persistent across reboots.

The following steps apply to RHEL, SUSE, and Ubuntu systems.

Persistent Change

This is the recommended method for changing your SWAP settings. It takes effect immediately and is persistent across reboots.

  1. Verify the limit of the swappiness parameter and the effects of changing it on your system.

  2. Edit the /etc/sysctl.conf file. Add the following entry:

     vm.swappiness=0 

    Ensure that you do not have duplicate entries for vm.swappiness in the file.

  3. Load the sysctl setting from the default file /etc/sysctl.conf. Run sysctl as follows:

 # sysctl -p 

Non-persistent change:

This method changes your SWAP settings temporarily. It is not persistent across reboots.

Verify the limit of the swappiness parameter and the effects of changing it on your system.

Run the sysctl command with the -w option from the command line:

 # sysctl -w vm.swappiness=0