echemi logo
Product
  • Product
  • Supplier
  • Inquiry
    Home > How to free the memory cache, buffer and swap space of Linux?

    How to free the memory cache, buffer and swap space of Linux?

    • Last Update: 2020-04-03
    • Source: Internet
    • Author: User
    Search more information of high quality chemicals, good prices and reliable suppliers, visit www.echemi.com
    Like any operating system, Linux implements effective memory management, even better But if a program eats memory and you want to clean it up, Linux provides an effective way to release the cache Each Linux system has three options to free the cache without interrupting programs or services 1 Only pagecache is cleaned #Sync; echo 1 > / proc / sys / VM / drop ﹣ caches 2, clean up dentries and inodes #Sync; echo 2 > / proc / sys / VM / drop ﹣ caches 3 Clean up pagecache, dentries and inodes #Sync; echo 3 > / proc / sys / VM / drop_cachesthe above commands are explained below "Sync" can release the file system buffer The command continues to run separated by ';' The command line waits for each command to end before executing the next sequential command As mentioned in the kernel file, writing drop ﹣ cache can clean up the cache without killing the application or service The job of the command "echo" is to write the file If you need to clean up the disk cache, the first command is the safest for the enterprise and production because " Echo 1 >.. only pagecache is cleaned Unless you know what you are doing, it is not recommended to use the third command mentioned above in the production process Echo3 >, because it cleans up pagecache, dentries, and inodes When you apply different settings and want to check, you may need to clean up the cache Releasing the cache as described above does not require a system restart, so there is no downtime Linux is designed to look at the disk cache before retrieving it If the resource can be found in the cache, the request will not reach the disk If the cache is cleared, the system looks for resources on the disk In addition, the system slows down for a few seconds when the cache is cleaned up, because every resource requested by the system needs to be reloaded into the disk cache.
    This article is an English version of an article which is originally in the Chinese language on echemi.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or complaint, to service@echemi.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.

    Contact Us

    The source of this page with content of products and services is from Internet, which doesn't represent ECHEMI's opinion. If you have any queries, please write to service@echemi.com. It will be replied within 5 days.

    Moreover, if you find any instances of plagiarism from the page, please send email to service@echemi.com with relevant evidence.