One tips to make your Ubuntu or other linux faster is by adding a swap space or swap file. Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space.
Swap space temporarily holds memory pages that are inactive. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. If the system happens to need more memory resources or space, inactive pages in physical memory are then moved to the swap space therefore freeing up that physical memory for other uses.
You need swap space or swap file if you have low memory but have enough space in your harddrive. Usually you need swap space is double of your RAM. So if you have 512MB RAM, make your swap file 1GB, and so on.
Her is how to make swap file in Ubuntu:
- Open your terminal and login as root
- Create a large empty file:
dd if=/dev/zero of=/mnt/512Mb.swap bs=1024M count=512
- Format the swap file:
- Turn the swap file on:
- The additional swap is now available and can be seen by :
- Add it to fstab to make it permanent:
- add this to the file:
/swap_file none swap sw 0 0