How to reduce SWAP Memory Usage on M1 Mac
It’s all over internet now. M1 Macs are using SWAP memory heavily which resulting in heavy Writes on SSD. Few users also reported that its up-to ~500 GB per day. This has raised concern over lifespan of SSD for MacBooks as it’s soldered to the motherboard and can not be replaced. To know more about it, you can read our previous post. So how to reduce SWAP Memory Usage on M1 Mac?
So after seeing all this, immediate question comes in our mind, how can I control this? Is it possible to reduce SSD writes by swap usage? Will my SSD give up just in a year due to this heavy writing?
So lets check it out.
Also ReadMacBook M1 Using SWAP Memory From SSD
What is SWAP & How it’s affecting SSD life-span
A Swap Memory is a space in the Hard Disk of your computer that Operating Systems will use to put the info that is actually on the RAM to free it for another application. Each SSD has its own life span i.e. how long it can hold data or work under read-write operation. Rather its more to deal with data change on the SSD than the read of data. In technical term, this is called as TBW i.e. terabytes written over time. MacBook uses SWAP from SSD to free RAM for another application. Due to heavy SWAP usage by M1 Macs, it will consume the TBW cycle, thus impacting overall lifespan of SSD as compared to low SWAP usage.
As per data showcased by Created Labs, major contributor to the Bytes Written to SSD is kernel_task. This is mainly related to the use of non-optimized M1 Apps. As these apps make use of Rozetta2 translation, as compared to native M1 apps, it need to do more work and thus make heavy use of SWAP.
How to reduce SWAP Memory Usage on M1 Mac
So how do we control it? Answer is simple, use M1 native apps as much as possible and avoid intel based apps. You may say this is not practical as not all apps are transitioned to M1. This is the reason that Apple is using Rozetta2 as translation layer. But still you can reduce the use of SWAP by kernel_task, you may ask how? Answer is, use Safari instead of Chrome or Firefox. This will reduce SWAP usage significantly. Also close app as soon as you are done with it so that it will be released from memory. If you follow these simple steps, then you can reduce SSD writes significantly.
So try this and share your observations!
With recent Big Sur 11.3 updates, Swap memory issues are addressed by Apple to the large extend. Hence do update to Big Sur 11.3 if you have not done it already.
Also on 4-May-2021, Apple also released Security update with 11.3.1. It’s recommended to install it to have latest Security Updates available on your Mac.
Update as of 1-Jul-2021
With most of the modern browsers, caching feature is by default enable to boost performance. What this caching do is putting files on your memory or in disk directly for quick access. With normal browsing you will not see any issue or difference. But if you watch online videos or web-series like on YouTube, Netflix, Amazon Prime etc. then you will this difference.
Just play a 4K video in YouTube on Chrome and then open your Activity Monitor. Search for Chrome and you will see some helper entries which is writing MB or in some case GB of data. If you monitor it, you can see that the amount of memory written is increasing quite fast. Below screenshot shows Bytes written in just few seconds.
Now let’s disable this caching and test. To do that enter below command in your Chrome address bar.
This will Open below Window. First entry is the one which is of our interest.
By default its not enabled to turn off caching. So from dropdown, select Enable and Relaunch application.
Now if we play again the same 4K video on YouTube, difference is quite high. Bytes written is very low now as compared to previous case.
Quite good right! But as this is good to most extend, there are few drawbacks as well. If you are watching a video and you closed your MacBook and when you open it again, you may need to reload the video as its not cached on your disk any more. But as per our tests with Chrome, we have not observed any other performance issue while working.
Similarly you can do same for other browsers like Firefox and Microsoft Edge. Configuration options are little different there, but if you want to know that just mention it in comment and we can have dedicated article on that to assist you.
M1 MacBooks are available on amazon India.