How to Add Temporary Swap Space in Linux

Linux Temporary Swap Space Creation Commands

In addition to a swap partition, Linux can also use a swap file. Some programs, like g++, can use huge amounts of virtual memory, requiring the temporary creation of extra space. To install an extra 64 MB of swap space, for example, use the following shell commands:
# dd if=/dev/zero of=/swap bs=1024 count=65535
# mkswap /swap
# swapon /swap

The count= argument to dd determines how big the swap file will be. In this example the swap file's name is /swap, but the name and location are, generally, arbitrary, depending only on the file system's available space and your having write permissions in the directory

When you don't need the swap space any more, remove it with the following statements:
# swapoff /swap
# rm /swap

Related Topic List of Mysql Error Code and Description
What is the Difference between Linux & Windows Swap Files
Linux Swap Partition Installation
How to Install Anti-virus ClamAV
How to Protect the Linux Machine against Dangerous Malware rootkits 2011   Privacy Policy  Terms of Service  Feedback