Clean cache under Linux to free up memory

Source: Internet
Author: User

 Free Total        used       free     shared    buffers     cachedmem:         1920472    1845892      74580              462708     338068-/+ buffers/cache:    1045116     875356Swap:            0           0          0
[Email protected] ~]#Sync[[Email protected]~]#Echo 1>/proc/sys/vm/Drop_caches[[email protected]~]#Echo 2>/proc/sys/vm/Drop_caches[[email protected]~]#Echo 3>/proc/sys/vm/Drop_caches[[email protected]~]# FreeTotal used Freeshared buffers Cachedmem:1920472    1015300     905172        184        992      46960-/+ Buffers/cache:967348     953124Swap:0          0          0[[Email protected]~]#

For a few days I didn't find out which application was using the memory.

Use the top command to check Tomcat, MySQL, MongoDB, Nginx, Fastdfs, Redis ... and other applications, have not found a high occupancy situation.

Helpless, on the Internet to see the above method, record down, first emergency use it.

Description

Remember to perform the sync command before releasing the cache to prevent data loss.

 Free Pagecache:  # echo 1 >/proc/sys/vm/drop_cachesfree  dentries and inodes:   # echo2 >/proc/sys/vm/drop_cachesfree  Pagecache, Dentries and Inodes:# echo3 >/proc/sys/vm/drop_caches

Literacy:

total--Total Physical memory used--used memory, this value is generally larger because this value includesthe memory used by the cache + application free-- Completely unused memory shared--application shared memory buffers--cache, mainly used for directory aspects, Inode value, etc. (LS Large directory can see this value increased) cached--cache for open files

Clean cache under Linux to free up memory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.