After the Linux system has been in operation for a long time, it will generate a lot of caches for watching videos and downloading files. If it is not regularly cleaned, it will cause the system to become very slow. The following small series will introduce you to the Linux release cache method.
caching mechanism
Linux system is quite advanced, he will for the dentry (for VFS, accelerated file pathname to inode conversion), Buffer Cache (for read and write disk blocks) and Page Cache (read and write for file inodes) performs caching operations. But after a lot of file operations, the cache will run out of memory resources. But in fact, our file operation has been completed, and this part of the cache is no longer used. At this time, can we only watch the cache occupy the memory space?
So, we still need to manually release the memory under Linux, in fact, is to release the cache operation.
To achieve the purpose of releasing the cache, we first need to understand the key configuration file /proc/sys/vm/drop_caches. The cache release parameter is recorded in this file. The default value is 0, that is, the cache is not released. His value can be any number between 0 and 3, which means different meanings:
0 – does not release
1 – release page cache
2 – Release dentries and inodes
3 – Release all caches
Once we know the parameters, we can use the following instructions to operate according to our needs.
First we need to use the sync command to write all unwritten system buffers to disk, including modified i-nodes, delayed block I/Os, and read-write mapping files. Otherwise, unsaved files may be lost during the release of the cache.
#sync
Next, we need to write the required parameters into the /proc/sys/vm/drop_caches file. For example, if we need to release all caches, enter the following command: Br>
#echo 3 》 /proc/sys/vm/drop_caches
This command takes effect immediately after it is entered. It can be queried that the available memory is significantly more.
To query the parameters of the current cache release, you can enter the following command:
#cat /proc/sys/vm/drop_caches
The above is the use of Linux to release the cache. The method is introduced. If you think your computer is getting more and more cards, then your memory may be occupied a lot. You may want to clean up the computer garbage.
There are two different exchange methods in Linux system, namely NBMA and BMA. Dont look at the two
After installing the Ubuntu system, the system default screen resolution is too low. The 1280*1024 d
Linux system operation, when prompted to start weblogic managed server error, there
In the Ubuntu system, sometimes the screen brightness is adjusted because the scree
Linux how to use the cal command to view the calendar
Linux how to use the ss command to view the socket status
Linux system hard disk failure repair method
How to log out of the login user under Linux
How to use the tail command guide under Linux
Linux to view Oracle related process methods through ps command
RedHat software source prompt Unable to read consumer identity?
A brief introduction to the use of jenkins in Linux systems
Linux software raid operation guide
What is the difference between the Linux command rmdir and rm?
Linux system Vsftpd server virtual user and passive mode configuration method
Win10 RS2 Preview 14942 fix content and known issues summary
IE9 browser win7 hand in the ten unknown function (3)
Win7 system right-click menu how to add "get trustedinstaller permissions" option
Win7 open software response slow response
Win7 system can not log in multiple QQ at the same time how to do
What should I do if the bluescreen blue screen appears in the win7 system?
How to set up XP disc auto play?