{"id":15304,"date":"2016-07-22T11:32:13","date_gmt":"2016-07-22T15:32:13","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=15304"},"modified":"2016-10-03T23:56:01","modified_gmt":"2016-10-04T03:56:01","slug":"what-exactly-is-compressed-memory","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/07\/22\/what-exactly-is-compressed-memory\/","title":{"rendered":"What Exactly Is &ldquo;Compressed Memory&rdquo;?"},"content":{"rendered":"<p><a href=\"http:\/\/arstechnica.com\/apple\/2013\/10\/os-x-10-9\/17\/\">John Siracusa<\/a>:<\/p>\n<blockquote cite=\"http:\/\/arstechnica.com\/apple\/2013\/10\/os-x-10-9\/17\/\"><p>In Mavericks, the OS has one more option before it has to resort to swapping: compressed memory. Mavericks will find the least-recently-used data in memory and compress it, usually to about half its original size. Et voil&agrave;, more free memory.<\/p>\n<p>[&#8230;]<\/p>\n<p>Memory compression is a triple play for Mavericks. It&rsquo;s a performance win; compressing and decompressing data in RAM is much faster than reading from and writing to disk, even an SSD. It&rsquo;s an energy win; the less time spent moving data between RAM and disk, the more time the system can spend in its idle state. And finally, it&rsquo;s a capability win; Mavericks can handle much more demanding workloads than previous versions of OS X before crying uncle.<\/p><\/blockquote>\n<p>This seems like a great feature, but I&rsquo;ve never fully understood how it&rsquo;s reported in Activity Monitor. What do the &ldquo;Compressed Memory&rdquo;&nbsp;numbers for each process and the &ldquo;Compressed&rdquo; total actually mean? This <a href=\"http:\/\/apple.stackexchange.com\/q\/107578\/2121\">AskDifferent post<\/a> lists the columns in Activity Monitor, but commenter James K Polk has the same questions as me:<\/p>\n<blockquote cite=\"http:\/\/apple.stackexchange.com\/questions\/107578\/memory-terminology-in-mavericks-activity-monitory#comment218744_112502\"><p>If the activity monitor says a given process uses 621.4 MB of memory and 615.4 MB of compressed memory, does that mean that the process is really only using up 6 MB of memory? Or that 615.4 out of 621.4 MB was compressed down to some unspecified size? Or something else?<\/p><\/blockquote>\n<p>In other words, does a high number for Compressed mean that the compression has been effective or that the system is nearing capacity because most of what can be compressed already is?<\/p>\n<p>It&rsquo;s also not clear how compressed memory interacts with the other reported numbers. For example, why did Siracusa&rsquo;s App Memory go down when the Compressed memory went up? I would have expected that App Memory would include the part that&rsquo;s compressed.<\/p>\n<p>And, presumably the memory that is paged out to disk is compressed. Does Swap Used take that into account?<\/p>\n<p>Update (2016-10-03): Activity Monitor in macOS 10.12 has a tooltip for the &ldquo;Compressed Memory&rdquo; column, which says &ldquo;Memory sent to the VM compression.&rdquo;<\/p>","protected":false},"excerpt":{"rendered":"<p>John Siracusa: In Mavericks, the OS has one more option before it has to resort to swapping: compressed memory. Mavericks will find the least-recently-used data in memory and compress it, usually to about half its original size. Et voil&agrave;, more free memory. [&#8230;] Memory compression is a triple play for Mavericks. It&rsquo;s a performance win; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[2],"tags":[1407,357,30,475,1056],"class_list":["post-15304","post","type-post","status-publish","format-standard","hentry","category-technology","tag-activity-monitor","tag-compression","tag-mac","tag-mavericks","tag-ram"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=15304"}],"version-history":[{"count":3,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15304\/revisions"}],"predecessor-version":[{"id":15909,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15304\/revisions\/15909"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=15304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=15304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=15304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}