Wednesday, May 25, 2022

Macbook Air M1 and RAM/Swap research

 Last night, after 3-4 days of the MBA running (mostly hibernating but I did use it maybe 10 hours or so), I took at look at the kernel_task process and it was at around 16TB of writing. (!!)

I didn't have a ton of apps open but did have 15 tabs in an open Firefox browser.  I'm thinking that was the culprit...many days of running without killing the process, when Firefox is notorious for memory leaks.

I shut it down then decided to remove the whole program since it was migrated from my old iMac.  It was almost certainly running an Intel version, which meant that it was being translated by Rosetta2 before being used by the M1's ARM chipset.  

I installed the Mac version but decided to also look into Microsoft Edge, which has some memory leak protections built-in (it hibernates inactive tabs, I believe).  I initially looked for it at the App Store but it wasn't there.  It was the same for FF for Mac - had to go to the FF page and download it, so I went to Microsoft's page, found the Mac M1 version, downloaded and installed it.

The plan is to start using Edge in place of FF so that I can take advantage of it's anti-leak properties, but still have FF on-hand in case I need it.  Yeah, I can use Safari, as well, but I've grown used to FF and Safari doesn't have the anti-leak protection.

I also ensured that the other software I migrated from the iMac (GarageBand, iMovie, Pages, Keynote, Numbers, etc) was using versions native to Apple silicon.  They are all running versions designed for the M1 chipset.

I then restarted the MBA so that the kernel_task writes could be watched after my changes.

So far, my kernel_task writes are low (437 MB) and I'm not swapping (I'm at 2 GB of unused RAM currently).

As well, I've researched the RAM and swap issue.  Even if I start swapping, even if it was heavy swapping, the life of my SSD should last well over 10 years.

I've also thought of creating extra swap files/partitions to a 2nd SSD I have, and redirecting the swapping to those locations (if possible for the latter).  I can always replace the 2nd SSD since it's not embedded into the MBA.  This may be an option later on, but I'll not worry about it now.

No comments: