When files are frequently accessed in Linux, the physical memory may be exhausted. when the program ends, the memory will not be released, but will always be used as a cache. Linux caches include dentry, buffercache, and pagecache. Dentry is used to accelerate the conversion of file pathnames to inode; buffercache accelerates disk block read/write; pagecache accelerates inode read/write. Shorten the IO call time. Memory release Method: 1. release pagecahce for Linux when files are frequently accessed, the physical memory may be exhausted. when the program ends, the memory will not be released, but will always be used as a cache.
Linux cache includes dentry, buffer cache, and page cache. Dentry is used to accelerate the conversion of file pathnames to inode; buffer cache accelerates disk block read/write; page cache accelerates inode read/write. Shorten the IO call time.
Memory release method:
1. Release page cahce
# Echo 1>/proc/sys/vm/drop_cache
2. release dentry and inode
# Echo 2>/proc/sys/vm/drop_cache
3. release the page cache, dentry, and inode.
# Echo 3>/proc/sys/vm/drop_cache
Before releasing the memory, it is best to allow sync to forcibly write the page cahce, dentry, and inode being processed by the system to the disk.
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