How to use a file as a swap memory ?
When the physical memory of the system (RAM) is full, swap memory is used. Swap memory is created at the time of operating system installation. We can later use a file as a swap memory. We need to first create a file.
1 |
dd if=/dev/zero of=/swapfile bs=1024 count=65535 |
This will create a 64Mb of swapfile. To create more larger swap file increase count value. count can be calculated as (count= ‘block size’ * ‘file size in Mb’).
1 2 |
sudo mkswap /swapfile sudo swapon /swapfile |
To check if swapfile is active or not run the command,
1 |
swapon -s |
If result is not found or irrelevant, Please contact us.
Submit your request