As we all know, swap is a block of virtual memory in a hard disk. Swap temporarily stores books that have not been activated. When the system determines that the physical memory RAM is required to activate the process, swap is used. If the system happens to need more memory resources or space, unactivated books in physical memory will be moved to the swap space, so free up space for him. The hard disk is much slower than RAM, which reduces the system response time. Therefore, if there is enough RAM, we can control swap usage to accelerate Ubuntu. There is a switch parameter to control the kernel from the physical memory
As we all know, swap is a block of virtual memory in a hard disk. Swap temporarily stores books that have not been activated. When the system determines that the physical memory RAM is required to activate the process, swap is used. If the system happens to need more memory resources or space, unactivated books in physical memory will be moved to the swap space, so free up space for him.
The hard disk is much slower than RAM, which reduces the system response time. Therefore, if there is enough RAM, we can control swap usage to accelerate Ubuntu.
There is a switch parameter that controls the kernel to move the process from the physical memory to the swap space. This parameter ranges from 0 to 100. When this parameter is set to 0, it indicates that the SWAp process is prevented from moving out of the physical memory whenever possible. This parameter is set to 100, this tells the kernel to move data out of the physical memory to the swap cache.
The default switching parameter is 60. For Ubuntu Desktop Users, we recommend that you set the switching parameter to 10.
Next we will accelerate our Ubuntu system step by step:
1. Open the terminal and check the value of the switch parameter. Enter the following command:
Cat/proc/sys/vm/swappiness
Use the following command to temporarily change the switching parameter to 10. After restart, the system will still restore the original state to 60:
Sudo sysctl vm. swappiness = 10
To change this parameter permanently, run the following command:
Gksudo gedit/etc/sysctl. conf
Search for the keyword "vm. swappiness" (without quotation marks) and change it to the value you want. If vm. swappiness does not exist, add:
Vm. swappiness = 10
After saving the file, restart it ~~