Linux Memory release

Source: Internet
Author: User

About Linux Memory release

First we may use free to see the memory usage, it should be this:[root@ipython ~]# free-m Total used free shared buffers cached mem:          32040      31707         332           0         498       27649 -/+ buffers/cache: 3559 28480 Swap: 16087 0 16087 # #实际上在一个进程结束后其内存是会被释放的, but the kernel does not immediately collect the memory into free, but is stored in the cache or buffers to improve the system's IO efficiency, cache and buffered memory is the kernel for dynamic configuration management, If the system free size is not enough, the system will automatically release cache buffer memory for the program to use! ### #证: If used occupies a lot, free is very small, and the cache and buffer ratio is also very low, which indicates that memory is not enough to use # #of course, if you still need to see the free more, you can try this:1. Use the Sync command to write all the system buffers that are not written to disk, including the modified I node, the deferred block i\ o, and the read-write mappings [root@ipython ~]# sync 2. Rough Cleaning[root@ipython ~]# cat/proc/sys/vm/drop_caches 0# #可以看到默认是0, Drop_caches offers three options operation # #1 Empty page cache 2 empty inode and directory tree cache 3 empty all caches # #清空缓存页 # #[root@ipython ~]# echo "1" >/proc/sys/vm/drop_caches # #再来看看 # #[root@ipython ~]# free-m Total used free shared buffers cached mem:          32040       2564      29475          0          0         40 -/+ buffers/cache: 2524 29515 Swap: 16087 0 16087

Linux Memory release

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.