Site icon BASIS GURU

Adding Swap to SUSE Linux

LINUX_www.basisguru.com

What is Swap

Swap is used to extend the available physical memory. It is possible to use more memory than physical RAM available.

Linux uses a page called “Least Recently Used” (LRU) to select pages that might be moved from memory to disk. Therefore, running applications have more memory available and caching works more smoothly.

Swap was being used as a saftey mechanism by the memory managment system of Kernel before version 2.4.10.

If the system has no swap, application gets the maximum allowed memory. All caches are freed and thus all other running applications are slowed. After a few minutes, the kernel’s out-of-memory kill mechanism activates and kills the process.

Adding A Swap File Manually In SUSE Linux

mkdir -p /var/lib/swap
dd if=/dev/zero of=/var/lib/swap/swapfile bs=1M count=128
mkswap /var/lib/swap/swapfile
swapon /var/lib/swap/swapfile
cat /proc/swaps
/var/lib/swap/swapfile swap swap defaults 0 0

Exit mobile version