{"id":344,"date":"2011-04-21T12:59:59","date_gmt":"2011-04-21T12:59:59","guid":{"rendered":""},"modified":"2013-02-07T12:12:19","modified_gmt":"2013-02-07T04:12:19","slug":"%e6%b8%85%e9%99%a4linux%e7%bc%93%e5%ad%98","status":"publish","type":"post","link":"https:\/\/dingxuan.info\/wp\/?p=344","title":{"rendered":"\u6e05\u9664Linux\u7f13\u5b58"},"content":{"rendered":"<p>Writing to this will cause the kernel to drop clean caches, dentries and<br \/>inodes from memory, causing that memory to become free.<br \/><br \/>To free pagecache:<br \/>echo 1 &gt; \/proc\/sys\/vm\/drop_caches<br \/>To free dentries and inodes:<br \/>echo 2 &gt; \/proc\/sys\/vm\/drop_caches<br \/>To free pagecache, dentries and inodes:<br \/>echo 3 &gt; \/proc\/sys\/vm\/drop_caches<br \/><br \/>As this is a non-destructive operation and dirty objects are not freeable, the<br \/><strong>user should run `sync&#8217; first.<\/strong>\n<br \/><br \/><pre class=\"brush: plain; title: ; notranslate\" title=\"\">&#x5B;root@server test]# cat \/proc\/sys\/vm\/drop_caches\n0<\/pre>\n<br \/>\/proc\/sys\/vm\/drop_caches\u7684\u503c,\u9ed8\u8ba4\u4e3a0<br \/>\u7b80\u5355\u8bf4\uff0c\u6e05\u9664\u7cfb\u7edf\u5bf9\u5185\u5b58\u7684cache\uff0c\u4f7f\u7528root\u505a\u4e0b\u9762\u51e0\u6b65\uff1a<br \/><pre class=\"brush: plain; title: ; notranslate\" title=\"\">sync; echo 3 &gt; \/proc\/sys\/vm\/drop_caches\nsync; echo 0 &gt; \/proc\/sys\/vm\/drop_caches<\/pre>\n<br \/><br \/><br \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Writing to this will cause the kernel to drop clean cac &hellip; <a href=\"https:\/\/dingxuan.info\/wp\/?p=344\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u6e05\u9664Linux\u7f13\u5b58<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[79,78],"class_list":["post-344","post","type-post","status-publish","format-standard","hentry","category-network","tag-centos","tag-linux"],"_links":{"self":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=344"}],"version-history":[{"count":0,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=\/wp\/v2\/posts\/344\/revisions"}],"wp:attachment":[{"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dingxuan.info\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}