While installing Oracle database for one of DEV environments we encountered a error due to small swap space available in machine. As this was used for Development only and not required to be production grade we have made a quick hack to fix the swap space issue without recreating the VM again. So before we dive into the quick hack let’s first know what is swap space and why its required.
A very crisp excerpt is swapping is necessary for two important reasons.
- When the system requires more memory than is physically available, the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately.
- A significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache.
Now to increase the swap space without recreating the VM can be done by below steps:
- Login as root and check what is the current swap space available and how much needs to be added more using below command.
Note: All outputs are in KB.