Linux computers have been used for a long time, and many of them are caused by insufficient memory. Users who use vps can easily find that the memory occupied by vps is very high. In order to ensure the normal use of the system, the system memory is released regularly. Importantly, the following is a way to clean up memory by command.
The WEB server built in the VPS runs for a long time, and the memory usage is occupied more and more. For the small memory VPS, the SWAP partition may be directly used, which affects the performance of the system application. . The following is a very simple script to clean up linux memory, as long as you put it into the crontab scheduled task, you can periodically clean up your Linux server memory.
The code is as follows
#! /bin/bash
#Data is written to the disk cache
sync
#Clean Page Cache
echo 1 》 /proc/sys/vm /drop_caches
sync
#Clean All Cache
echo 3 》 /proc/sys/vm/drop_caches
where /proc/sys/vm/There are 4 values in drop_caches, respectively 0-3:
0 – do not release
1 – release page cache
2 – release dentries and inodes
3 & ndash; the release of all cache
Scripting and script executable permissions given into the crontab which regularly perform:
supplement: free the memory manually Method
The code is as follows
sudo sh -c “echo 1 》 /proc/sys/vm/drop_caches”
sudo sh -c “echo 2 》 /proc /sys/vm/drop_caches”
sudo sh -c “echo 3 》 /proc/sys/vm/drop_caches”
The above is the way Linux uses commands to clean up memory. The main introduction is the command cleanup. Many tools can play a role in the release of memory.
Nessus is a system vulnerability scanning and analysis software, but Nessus install
Some enterprise users have dual servers. Sometimes they need to switch the IP of th
Learning the knowledge of character sets in Linux system can solve many system prob
On Linux systems, the root user has the highest privilege, can do anything, delete
How to modify the file time of the Linux system
What is optimized for Linux kernel 4.2?
Ubuntu 12.04 how to install and use Byobu
How to test the performance of a Linux disk using the DD command?
How to configure Kickstart script
What are the differences between the three load balancing methods of LVS?
Linux viewing system installed kernel operation method
Linux how to debug multi-process program
How to use the backup-manager tool to back up the Linux system
Linux using xshell and xftp methods
Win10 opens two methods of mail application. The modern style application of the
Computer company win7 system boot prompt "Runtime Error wmpnscfg.exe R6016" solution
Win10 IoT core preview version update package download address
The Win7 system can not be loaded after the boot and the background is black.
Windows XP system when booting Common process list
Where is the windows7 camera? How to find the win7 camera?
Windows7 operating system basic tutorial Basic 2: use the mouse (a)
Pay attention to computer security, take you to recognize several symptoms of the virus
Resolve account and permission functions in the Windows XP operating system
Want a good WiFi experience. Install a good tool for the win10 system