How to Add Swap Memory to your Ubuntu Server
Don’t worry even if your server has only 512 MB RAM, you can actually increase your server memory with help of swap files.In any case they are somewhat deficient regarding RAM. 615mb of RAM is sufficient to test utilizing the support and doing essential things. Anyway in the event that you need to begin doing element website pages or even begin doing database driven stuff you may begin to use up memory rapidly.
Considering this present its justified even despite making a swap “record” to facilitate the torment if you use up virtual RAM.
1gb of swap ought to be sufficient. So make your swap record in the base of your filesystem:
Follow these commands in your SSH terminal (PUTTY or any SFTP client)
The swap memory can be created as follows
[root ~]# dd if=/dev/zero of=/swapfile bs=1M count=1024
# mkswap /swapfile
# swapon /swapfile
swap swap defaults 0 0