If you have very little resource to work with a very wide scope of processes, you might want to have a swap space with your machine. Actually having real RAM is always the best solution but what GNU/Linux acutally does with SWAP is putting the inactive and init processes which are only used in initialization other processes and never used later, over swap. So that won’t make the performance worse but keeping the system attain in some points of working.
To see if your system have working swap system.
You will see the working swap systems listed if they are already on your system. Or we are going to make one.
Create a swap file which is 512 MB in size. ( 1024 * 512 = 524288 block size )
[ /dev/zero is a special file in Unix-like operating systems that provides as many null characters (ASCII NUL, 0x00) as are read from it. One of the typical uses is to provide a character stream for initializing data storage. wiki]
And secure the swap file.
Let the system know.
To activate the created swap partion on the reboot, edit /etc/fstab:
[ The fstab (or file systems table) file is a system configuration file commonly found at /etc/fstab on Unix and Unix-like computer systems. In Linux it is part of the util-linux package. The fstab file typically lists all available disk partitions and other types of file systems and data sources that are not necessarily disk-based, and indicates how they are to be initialized or otherwise integrated into the larger file system structure. wiki]
1 2 3
Copy the second output line made from “swapon -s” command and paste it onto /etc/fstab
/swapfile1 file 524284 0 -1
Then check the system.
1 2 3 4 5