{"id":797,"date":"2012-07-23T12:40:07","date_gmt":"2012-07-23T04:40:07","guid":{"rendered":"http:\/\/rmohan.com\/?p=797"},"modified":"2012-07-23T12:40:07","modified_gmt":"2012-07-23T04:40:07","slug":"free-m","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=797","title":{"rendered":"free -m"},"content":{"rendered":"<pre><strong>free -m\r\n\r\n<ins><ins id=\"aswift_0_anchor\"><\/ins><\/ins><\/strong><\/pre>\n<pre>Use 'free -m' utility to get REAL memory usage.\r\n\r\n[u...@server \/]# free -m\r\n             total       used       free     shared    buffers     cached\r\nMem:          3876       3557        319          0        212       1083\r\n-\/+ buffers\/cache:       2261       1615\r\nSwap:            0          0          0<\/pre>\n<pre><strong><tt>That means I have 3876MB total used memory. 2261MB of it is allocated <\/tt><tt>and needed. \r\n1083MB is cached (mostly filesystem) and total free memory <\/tt><tt>is 1615MB.\r\n<\/tt><tt>If you want, you can clear linux cache (but it doesn't do any good. <\/tt><tt>Because since it's not cached anymore,\r\nit will be read from disk which <\/tt><tt>is a lot slower (and well, cached again). \r\nIt might be good only if you <\/tt><tt>just read something really big..and\r\nknow that you will never need to get <\/tt><tt>it again and need room for something else to cache.\r\nThe cache itself is <\/tt><tt>working automagically throwing out older items and caching new items). <\/tt><\/strong><\/pre>\n<pre>just to experiment use this command:\r\n|sync; echo 3 &gt; \/proc\/sys\/vm\/drop_caches\r\n\r\n|To clear cache. Beware that it might bump your load average for a sec.<\/pre>\n<pre><strong>\r\n<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>free -m Use &#8216;free -m&#8217; utility to get REAL memory usage. [u&#8230;@server \/]# free -m total used free shared buffers cached Mem: 3876 3557 319 0 212 1083 -\/+ buffers\/cache: 2261 1615 Swap: 0 0 0 That means I have 3876MB total used memory. 2261MB of it is allocated and needed. 1083MB is cached (mostly [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/797"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=797"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/797\/revisions"}],"predecessor-version":[{"id":798,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/797\/revisions\/798"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}