CentOS7 how to clear yum cache and release memory

Source: Internet
Author: User
Clear yum cache use yumclean command, yumclean parameters include headers, packages, metadata, dbcache, plugins, expire-cache, rpmdb, allyumcleanheaders # clear/var/cache/yum headersyumcleanpackages # clear/var clear yum cache

Run the yum clean command to clear yum cache. The yum clean parameters include headers, packages, metadata, dbcache, plugins, expire-cache, rpmdb, and all.

Yum clean headers # clear/var/cache/yum headersyum clean packages # clear the software package yum clean metadata under/var/cache/yum...
Linux releases memory

To free pagecache ):

sync; echo 1 > /proc/sys/vm/drop_caches

Release directory items and indexes (To free dentries and inodes ):

sync; echo 2 > /proc/sys/vm/drop_caches

Release the webpage cache, directory items, and indexes (To free pagecache, dentries and inodes ):

sync; echo 3 > /proc/sys/vm/drop_caches

The following is my actual data.

[Root @ localhost ~] # Free-m # View memory total used free shared buff/cache availableMem: 481 224 120 136 1 202 1023 Swap: 283 740 [root @ localhost ~] # Sync; echo 3>/proc/sys/vm/drop_caches [root @ localhost ~] # Free-m # from 120 to 186, the memory total used free shared buff/cache availableMem: 481 209 186 222 1 85 1023 Swap: 283 740 is released

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.