You can get memory information
using free. The recommended swap space is twice the
size of the physical memory. When you upgrade the system
memory, you may need to increase the swap space as well. The most
recommended way is to resize an existing swap partition or to
use another swap partition. However, this involves adjusting
disk partition, which may not be easily done in some cases. The
second best method is to use a swap file. The following series
of command shows how to this. Let us assume that we are adding a
swap file of which size is 120MBytes. You need to be the root.
# cd /mnt
# dd if=/dev/zero of=one.swp bs=1024 count=131072
# mkswap -c /mnt/one.swp
# swapon /mnt/one.swp
# free Edit /etc/fstab file to add the
following line so that the swap file can be used automatically at
every boot.
/mnt/one.swp none swap defaults 0 0