Option # 3 - Create a swap file.
1. Create a swap file on the current File system for example on root, for this a new Directory can be created.
2. Create a new file into this new directory, in this example a new file for 2Gb is create.
3. Create a new swap area on the file that has been created.
4. Change the permissions on the file.
5. Add the swap partition to the /etc/fstab file as indicated below on this step
6. Load the new swap space that had been created for the Instance.
7. To list the swap devices run the below command.
The new swap area that the instance will have available can be checked with this command below.
total used free shared buff/cache available
Mem: 14763 256 11898 65 2608 14102
Swap: 12661 0 12661 <<<==== Total Swap area
command Line Usage
The required filesystem size is set during the mount(8) operation. Resize a mounted filesystem by using the remount option along with the new filesystem size.
/etc/fstab Usage
Using /etc/fstab allows the size to be set automatically during system reboot. If the line is missing just add it and reboot the O/S.
========