Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

dmr727

macrumors G4
Dec 29, 2007
10,669
5,770
NYC
Really anyone wanting to use command line tools like this is better off just following the brew.sh installation instructions and using brew install smartmontools. It is easier than trying to explain command lines and shell variables and PATH to people.

I agree completely. I was just curious about the downloadable .dmg because someone said it was broken. It's not, although I can see how it'd be confusing for folks not used to using command line tools.
 

dmr727

macrumors G4
Dec 29, 2007
10,669
5,770
NYC
It doesn't run. I'm talking about the exact same commands that I used in the Homebrew version.

The uninstall command wouldn't work either. I ended up removing it manually, so the Homebrew version would work. It also required sudo to edit or remove.

It ran fine for me. 🤷
 

Dockland

macrumors 6502a
Feb 26, 2021
968
8,944
Sweden
In my situation on my M1 Macbook Pro, this is exactly what it was doing. And I observed this all the way back in December after noticing the unusually high SSD writes in Activity Monitor.

I tested Chrome, Edge, Safari, and Safari Technology Preview, with specific browsing use cases to make my comparisons as fair as possible. The memory usage from lowest to highest was clear: Edge, followed by Chrome, followed by both Safaris.

This was observed using Activity Monitor over atleast a couple of days for each because I figured if I was going to switch browser, it would be to the ‘correct’ one so I wouldn’t have to be concerned with it later on.

Safari is simply too greedy with the way it writes parts of any and every website after closure into its ‘Safari Web Content (Cached)’, which was truly causing my M1 to swap like crazy, and SSD writes were up to even 1TB+ after just two days. Yes, the way it caches so aggressively does mean that on slower connections it will appear faster because of said caching, but this seems to be done at the expense of all this caching and consequently SSD lifespan.

Not only this, but ofcourse neither Safari has any ‘Sleeping Tabs’ or tab suspender feature, and there is only one tab suspender on Safari available which in my experience did not improve my SSD writes as the excessive caching was still occurring.

Edge/Chrome on the other hand, both have built in ‘Sleeping Tabs‘ which can be set to save resources after a tab is unused for an x period of time. Effectively it’s like sleeping a background application that is idle - tabs with text input or with media playback are ignored. Additionally, they have much wider selections of extensions available and countless tab suspension extensions. In my case I decided to go with The Great Tab Suspender 7.1.6, and I turned on all the memory saving features in there, and I went 11 hours yesterday with 40 tabs ‘open’ by the end of the day, with only 700MB of swap and 45GB of SSD writes. Additionally I’ve done the Time Machine tweak mentioned here, and I went into spotlight settings and limited indexing of file types I never search for (I only use it as an app launcher), as well as various system folders that I would never need to search anyway.

In my personal situation, it seems my excessive SSD writes are resolved. I’ve gotten to love Edge after switching to LastPass and some other cool extensions like Dark Reader which has changed evening/night browsing for me forever, and the suspending of background tabs is awesome and barely noticeable really as websites load back fast anyway.

That being said I’d still love Apple to address this safari caching/kernel_task/swapping issue, which is likely plaguing countless M1/BigSur users without them even realising, which could lead to premature mac deaths down the line and ultimately loss of reputation (why did you have to solder the SSDs apple :D).

Thank You for this post. I suspected that Safari used more RAM than I was used to. Have used Safari exclusively for a couple of days. Even closing tabs in Safari doesn't seem to reduce that much RAM allocation.

So I installed Google Chrome (M1) and it's around 15-20% less memory used than in Safari. Same tabs opened. Google Chrome seem more dynamic as well. Closing tabs reduces RAM allocation on the fly.

Actually I don't really care what browser I use, but it would be nice to have Safari at least as good as Google Chrome, according to memory consumption.
 
  • Like
Reactions: TheSynchronizer

telo123

macrumors 6502
Mar 11, 2021
318
402
Thank You for this post. I suspected that Safari used more RAM than I was used to. Have used Safari exclusively for a couple of days. Even closing tabs in Safari doesn't seem to reduce that much RAM allocation.

So I installed Google Chrome (M1) and it's around 15-20% less memory used than in Safari. Same tabs opened. Google Chrome seem more dynamic as well. Closing tabs reduces RAM allocation on the fly.

Actually I don't really care what browser I use, but it would be nice to have Safari at least as good as Google Chrome, according to memory consumption.
If only we could turn off Caching in Safari. We were able to do so in the past, but the option is gone now. That’s probably the reason why Safari can be quite as fast as it keeps cache on the reserve. But, at the added cost of memory consumption.
 

Maximara

macrumors 68000
Jun 16, 2008
1,707
908
“Apple claims that Safari on ‌‌macOS Big Sur‌‌ is "50% faster on average at loading frequently visited websites than Chrome."

As a non-technical person it just smells like Safari is out there nearly constantly writing your frequently visited websites in the background to gain this speed advantage. For Apple to be so quiet about this issue there must be something like this they don’t want to have to give up being able to boast a claim about.

I’m sure this has or can be debunked but sometimes you have to look at the non-technical and non-measurable areas for answers. Sherlock Holmes said “Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth.”
Technically it was Sir Arthur Conan-Doyle through his creation (he had at lease two cases of his own) but I agree as if you cross check the number some of them predict TBW for the drive that are off the wall gonzo insane - 8500 in one case.

I should mention that companies lowball the TBW of their drives for warranty reasons which is why Apple, IMHO, will never give the TBW on the SSDs it uses. At best it would only give the warranty number and everybody would be freaking out more then they already are as many people don't seem to understand how those numbers work. A lot of people think once the SSD reaches 100% its going to die; in reality is will likely go way beyond that number.

Yes, it is akin to throwing dice and one should have an external drive as a back up but it is just a guide not an absolute.
 

Maximara

macrumors 68000
Jun 16, 2008
1,707
908
Is it a coincidence that since I excluded the main drive from TM, apart from smaller writes, the swap used is A LOT less? I am doing my usual work with the same stuff running as usual, and the swap has been at less than 4 GB for hours. Before it was jumping to 20 GB very often. WTF Can there be a link between TM and swap too? I haven't changed anything else other than reinstalling the OS yesterday, so maybe it's that. Boh.
As I have found that TM will still do its own disk archiving even if you have the TM physically connected to your machine. I found this out when doing a restore of my 2013 iMac and wondering why my system HD had way less memory then it should. Ok when you don't have a TM connected that makes sense but not when you have one connected. Tha ton its own would east up a lot of GB and with TM doing its thing every hour that mounts up.
 

Tev11

macrumors member
Apr 1, 2017
60
42
Thank You for this post. I suspected that Safari used more RAM than I was used to. Have used Safari exclusively for a couple of days. Even closing tabs in Safari doesn't seem to reduce that much RAM allocation.

So I installed Google Chrome (M1) and it's around 15-20% less memory used than in Safari. Same tabs opened. Google Chrome seem more dynamic as well. Closing tabs reduces RAM allocation on the fly.

Actually I don't really care what browser I use, but it would be nice to have Safari at least as good as Google Chrome, according to memory consumption.
Yes, the main reason as to why closing tabs in Safari doesn't reduce RAM allocation is because it keeps it in cache, so if you ever need to go back to that page, it loads "quicker." Granted, these devices (I'm assuming you have M1 because of this thread) are so fast that you probably cannot discern the difference in loading that page, cached or un-cached.

Safari before Big Sur (or at least non M1 Mac's) have always been the resource efficient king. Guess that title now belongs to Edge.

BUT, if this behaviour is not what Apple expected, I would imagine a future software fix for it.
 
  • Like
Reactions: Dockland

tab0reqq

macrumors newbie
Feb 25, 2021
25
36
Warszawa, Polska
Well. Excluded whole drive from TimeMachine (which I don't use either). I see no dramatic difference

Code:
jarek@MacBook-Air-Jarosaw ~ % uptime              
 8:04  up 1 day, 11:46, 2 users, load averages: 1,65 1,59 1,81
jarek@MacBook-Air-Jarosaw ~ % last reboot         
reboot    ~                         Thu Mar 11 20:18 
reboot    ~                         Thu Mar 11 09:13 
reboot    ~                         Wed Mar 10 13:28 
reboot    ~                         Mon Mar  8 23:59 

wtmp begins Mon Mar  8 23:59 
jarek@MacBook-Air-Jarosaw ~ % vm_stat             
Mach Virtual Memory Statistics: (page size of 16384 bytes)
Pages free:                                4034.
Pages active:                            366087.
Pages inactive:                          361092.
Pages speculative:                         3645.
Pages throttled:                              0.
Pages wired down:                        134885.
Pages purgeable:                           3365.
"Translation faults":                 149848627.
Pages copy-on-write:                    2812374.
Pages zero filled:                     72339800.
Pages reactivated:                     29934256.
Pages purged:                           1621271.
File-backed pages:                       176593.
Anonymous pages:                         554231.
Pages stored in compressor:             1118395.
Pages occupied by compressor:            137034.
Decompressions:                        24563469.
Compressions:                          29601026.
Pageins:                                4078568.
Pageouts:                                126603.
Swapins:                               34281563.
Swapouts:                              35002274.
jarek@MacBook-Air-Jarosaw ~ %
Zrzut ekranu 2021-03-13 o 08.05.55.png
Zrzut ekranu 2021-03-13 o 08.06.05.png
 
  • Like
Reactions: Forti and Dockland

wirtandi

macrumors regular
Feb 3, 2021
179
179
Well. Excluded whole drive from TimeMachine (which I don't use either). I see no dramatic difference

Code:
jarek@MacBook-Air-Jarosaw ~ % uptime             
8:04  up 1 day, 11:46, 2 users, load averages: 1,65 1,59 1,81
jarek@MacBook-Air-Jarosaw ~ % last reboot        
reboot    ~                         Thu Mar 11 20:18
reboot    ~                         Thu Mar 11 09:13
reboot    ~                         Wed Mar 10 13:28
reboot    ~                         Mon Mar  8 23:59

wtmp begins Mon Mar  8 23:59
jarek@MacBook-Air-Jarosaw ~ % vm_stat            
Mach Virtual Memory Statistics: (page size of 16384 bytes)
Pages free:                                4034.
Pages active:                            366087.
Pages inactive:                          361092.
Pages speculative:                         3645.
Pages throttled:                              0.
Pages wired down:                        134885.
Pages purgeable:                           3365.
"Translation faults":                 149848627.
Pages copy-on-write:                    2812374.
Pages zero filled:                     72339800.
Pages reactivated:                     29934256.
Pages purged:                           1621271.
File-backed pages:                       176593.
Anonymous pages:                         554231.
Pages stored in compressor:             1118395.
Pages occupied by compressor:            137034.
Decompressions:                        24563469.
Compressions:                          29601026.
Pageins:                                4078568.
Pageouts:                                126603.
Swapins:                               34281563.
Swapouts:                              35002274.
jarek@MacBook-Air-Jarosaw ~ %
View attachment 1743083
View attachment 1743084
As someone with 16/256, would you say your SSD wear falls into the average case or severely bad case?
 

telo123

macrumors 6502
Mar 11, 2021
318
402
"Each health indicator (S.M.A.R.T. attribute) has a raw value aka raw data. Raw measured values (provided by a sensor or a counter) are stored in this field. Sometimes different parts (high word, low word, etc) of raw value contain different kinds of information.

The drive manufacturer defines the meaning of this value (but often corresponds to counts or a physical unit). The exact meaning of raw value often considered a trade secret. These values may significantly vary between different manufacturers and drive models and should NOT be compared with other devices or other vendors."

This is from DriveDX. Take from it what you will.
 
  • Like
Reactions: gank41

tab0reqq

macrumors newbie
Feb 25, 2021
25
36
Warszawa, Polska
Right now I have 18 TBW. I guess it's not dramatic (as some report over 100TBW) but I think it's very worrying.
With that tempo in 12 I'll be at 130-140 TBW.

If we were 100% sure that 256GB has for an example 750 TBW of lifespan, than I it only would look a little bit better. But still 5 years from a laptop with non-removable parts for me is not acceptable. It should last at least 10 years. People are still using iPad 1gen and the only issue might be battery. Same goes with older Macbooks.

Right now we are just unsure if planned obsolesce has gone too far.


Code:
smartctl 7.2 2020-12-30 r5155 [Darwin 20.3.0 arm64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP0256Q
Serial Number:                      0ba0108b61388231
Firmware Version:                   1161.80.
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               3
Local Time is:                      Sat Mar 13 09:55:28 2021 CET
Firmware Updates (0x02):            1 Slot
Optional Admin Commands (0x0004):   Frmw_DL
Optional NVM Commands (0x0004):     DS_Mngmt
Maximum Data Transfer Size:         256 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        38 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    1%
Data Units Read:                    35 313 613 [18,0 TB]
Data Units Written:                 33 143 791 [16,9 TB]
Host Read Commands:                 209 435 264
Host Write Commands:                151 145 455
Controller Busy Time:               0
Power Cycles:                       94
Power On Hours:                     136
Unsafe Shutdowns:                   4
Media and Data Integrity Errors:    0
Error Information Log Entries:      0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745
 

Maximara

macrumors 68000
Jun 16, 2008
1,707
908
Right now I have 18 TBW. I guess it's not dramatic (as some report over 100TBW) but I think it's very worrying.
With that tempo in 12 I'll be at 130-140 TBW.

If we were 100% sure that 256GB has for an example 750 TBW of lifespan, than I it only would look a little bit better. But still 5 years from a laptop with non-removable parts for me is not acceptable. It should last at least 10 years. People are still using iPad 1gen and the only issue might be battery. Same goes with older Macbooks.

Right now we are just unsure if planned obsolesce has gone too far.


Code:
smartctl 7.2 2020-12-30 r5155 [Darwin 20.3.0 arm64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       APPLE SSD AP0256Q
Serial Number:                      0ba0108b61388231
Firmware Version:                   1161.80.
PCI Vendor/Subsystem ID:            0x106b
IEEE OUI Identifier:                0x000000
Controller ID:                      0
NVMe Version:                       <1.2
Number of Namespaces:               3
Local Time is:                      Sat Mar 13 09:55:28 2021 CET
Firmware Updates (0x02):            1 Slot
Optional Admin Commands (0x0004):   Frmw_DL
Optional NVM Commands (0x0004):     DS_Mngmt
Maximum Data Transfer Size:         256 Pages

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
0 +     0.00W       -        -    0  0  0  0        0       0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        38 Celsius
Available Spare:                    100%
Available Spare Threshold:          99%
Percentage Used:                    1%
Data Units Read:                    35 313 613 [18,0 TB]
Data Units Written:                 33 143 791 [16,9 TB]
Host Read Commands:                 209 435 264
Host Write Commands:                151 145 455
Controller Busy Time:               0
Power Cycles:                       94
Power On Hours:                     136
Unsafe Shutdowns:                   4
Media and Data Integrity Errors:    0
Error Information Log Entries:      0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745
Ok, 16.9*100/1 = 1690 TBW for the drive. Who besides me looks at that projected TBW for 100% and goes "uh, isn't that little high?" Yes, I know that SSDs go well beyond the TBW they are warranted for but isn't this warranted TBW what is being used to figure the pecentrage?

As I keep saying the numbers just don't make sense.
 

k-hawinkler

macrumors 6502
Sep 14, 2011
260
88
Ok, 16.9*100/1 = 1690 TBW for the drive. Who besides me looks at that projected TBW for 100% and goes "uh, isn't that little high?" Yes, I know that SSDs go well beyond the TBW they are warranted for but isn't this warranted TBW what is being used to figure the pecentrage?

As I keep saying the numbers just don't make sense.

I don’t think the formula is wrong, but garbage in, garbage out.
 

Maximara

macrumors 68000
Jun 16, 2008
1,707
908
I don’t think the formula is wrong, but garbage in, garbage out.
That has been my whole point. And there is no way the formula itself is wrong as if x is y percent then 100% is x*100/y; it isn't even middle school math. People are acting like the numbers mean something when the math should be sending up more red flags then a 25 car pile up in the Indianapolis 500.
 

badsimian

macrumors 6502
Aug 23, 2015
374
200
Well. Excluded whole drive from TimeMachine (which I don't use either). I see no dramatic difference

Code:
jarek@MacBook-Air-Jarosaw ~ % uptime             
8:04  up 1 day, 11:46, 2 users, load averages: 1,65 1,59 1,81
jarek@MacBook-Air-Jarosaw ~ % last reboot        
reboot    ~                         Thu Mar 11 20:18
reboot    ~                         Thu Mar 11 09:13
reboot    ~                         Wed Mar 10 13:28
reboot    ~                         Mon Mar  8 23:59

wtmp begins Mon Mar  8 23:59
jarek@MacBook-Air-Jarosaw ~ % vm_stat            
Mach Virtual Memory Statistics: (page size of 16384 bytes)
Pages free:                                4034.
Pages active:                            366087.
Pages inactive:                          361092.
Pages speculative:                         3645.
Pages throttled:                              0.
Pages wired down:                        134885.
Pages purgeable:                           3365.
"Translation faults":                 149848627.
Pages copy-on-write:                    2812374.
Pages zero filled:                     72339800.
Pages reactivated:                     29934256.
Pages purged:                           1621271.
File-backed pages:                       176593.
Anonymous pages:                         554231.
Pages stored in compressor:             1118395.
Pages occupied by compressor:            137034.
Decompressions:                        24563469.
Compressions:                          29601026.
Pageins:                                4078568.
Pageouts:                                126603.
Swapins:                               34281563.
Swapouts:                              35002274.
jarek@MacBook-Air-Jarosaw ~ %
View attachment 1743083
View attachment 1743084
Is this the same as having automatic time machine backups switched off and having no time machine target drives attached (which is what I did)
 

Kyros_G

macrumors newbie
Mar 13, 2021
3
0
I'm by no mean an expert on the topic.
But I think we have to also define a proper metric when checking our SDDs status, so to have a valid comparison on our results.

Checking on "X TBs in Y months" approach , says actually nothing since it may refer to intense or rare usage.
Not even dividing with days provides clarity.

In my opinion, a proper and comparable metric for our stats is
[Written GBs per 1 Power-On hour]
by dividing total Data written with total power-on hours .

Most of the examples reported here vary mainly between 50-90 GBs/hour.
 
Last edited:

IceStormNG

macrumors 6502a
Sep 23, 2020
517
676
Well. Excluded whole drive from TimeMachine (which I don't use either). I see no dramatic difference

Code:
jarek@MacBook-Air-Jarosaw ~ % uptime            
8:04  up 1 day, 11:46, 2 users, load averages: 1,65 1,59 1,81
jarek@MacBook-Air-Jarosaw ~ % last reboot       
reboot    ~                         Thu Mar 11 20:18
reboot    ~                         Thu Mar 11 09:13
reboot    ~                         Wed Mar 10 13:28
reboot    ~                         Mon Mar  8 23:59

wtmp begins Mon Mar  8 23:59
jarek@MacBook-Air-Jarosaw ~ % vm_stat           
Mach Virtual Memory Statistics: (page size of 16384 bytes)
Pages free:                                4034.
Pages active:                            366087.
Pages inactive:                          361092.
Pages speculative:                         3645.
Pages throttled:                              0.
Pages wired down:                        134885.
Pages purgeable:                           3365.
"Translation faults":                 149848627.
Pages copy-on-write:                    2812374.
Pages zero filled:                     72339800.
Pages reactivated:                     29934256.
Pages purged:                           1621271.
File-backed pages:                       176593.
Anonymous pages:                         554231.
Pages stored in compressor:             1118395.
Pages occupied by compressor:            137034.
Decompressions:                        24563469.
Compressions:                          29601026.
Pageins:                                4078568.
Pageouts:                                126603.
Swapins:                               34281563.
Swapouts:                              35002274.
jarek@MacBook-Air-Jarosaw ~ %
View attachment 1743083
View attachment 1743084

In your case, your machine is swapping a lot.

Look at swapins and swapouts. M1 arm64-darwin kernel uses 16kiB page size for memory.

34281563 pages have been swapped in and 35002274 have been swapped out.

35002274 * 16kiB = 560036384kiB = 534.09GiB (swapout)
34281563 * 16kiB = 548505008kiB = 523.09GiB (swapin)

Your machine swapped a total volume of more than 500GiB in about 1 day.
 
  • Like
Reactions: ambient_light

Donga120

macrumors 6502a
Sep 19, 2014
889
609
UK
I used Onyx to clear everything and mine seems to be writing a lot less now, I was not writing a lot anyway but I was averaging 20-30GB a day with barely very minimal usage, used the laptop for the past 6 hours and written about half that so far.
 

ambient_light

macrumors member
Feb 23, 2021
59
65
In your case, your machine is swapping a lot.

Look at swapins and swapouts. M1 arm64-darwin kernel uses 16kiB page size for memory.

34281563 pages have been swapped in and 35002274 have been swapped out.

35002274 * 16kiB = 560036384kiB = 534.09GiB (swapout)
34281563 * 16kiB = 548505008kiB = 523.09GiB (swapin)

Your machine swapped a total volume of more than 500GiB in about 1 day.
Would reiterate, that it's pretty obvious from all the info in this thread, that kernel does excessive *redundant* swaps due to some sort of OS memory management bug. It's important to understand, that the swapping per se is not an issue, but rather the fact that system is doing it again and again very frequently, even when there's no memory pressure.

As a workaround turned swap off on my MBA 16/1Tb in order to observe the system stability over weekend .... so far so good, no more "mysterious" writes from kernel_task... Obviously the OS will hiccup when the memory limit is hit.
 
Last edited:
  • Like
Reactions: k-hawinkler

IceStormNG

macrumors 6502a
Sep 23, 2020
517
676
Would reiterate, that it's pretty obvious from all the info in this thread, that kernel does excessive *redundant* swaps due to some sort of OS memory management bug. It's important to understand, that the swapping per se is not an issue, but rather the fact that system is doing it again and again very frequently, even when there's no memory pressure.

As a workaround turned swap off on my MBA 16/1Tb in order to observe the system stability over weekend .... so far so good, no more mysterious writes ... Obviously the OS will hiccup when the memory limit is hit.

Well, yeah. But that could be more of a Big Sur bug than a M1 problem. My 16" with 32GB RAM also swaps a lot without any reason. I disabled swapping for now and only leave memory compression on. There's still plenty of RAM even with multiple VMs or other memory heavy apps open. No stability issues. On a M1 with only 8GB of RAM, I wouldn't recommend it though. macOS can take 4-6GB RAM on its own and its background services. Spotlight, windowserver and the kernel itself hog a lot of memory.

There's really no reason for it to swap. That's why I bought that much RAM in the first place.

But that's just a bandaid for now. Apple should fix the swap behavior to only swap when it's actually needed. Memory compression and dropping caches should be preferred over excessive swapping.
 

Burebista

macrumors regular
Oct 8, 2019
221
231
No. Activity Monitor resets after ever reboot. smartmontools reads the data that the disk controller reports. This data does never reset and reflects the state over the whole lifetime.
Yes, I understand that difference. What I was trying to ask is - does Activity monitor and smartmontools report same numbers over same period of time? Did anyone check?
 

ambient_light

macrumors member
Feb 23, 2021
59
65
Well, yeah. But that could be more of a Big Sur bug than a M1 problem. My 16" with 32GB RAM also swaps a lot without any reason. I disabled swapping for now and only leave memory compression on. There's still plenty of RAM even with multiple VMs or other memory heavy apps open. No stability issues. On a M1 with only 8GB of RAM, I wouldn't recommend it though. macOS can take 4-6GB RAM on its own and its background services. Spotlight, windowserver and the kernel itself hog a lot of memory.

There's really no reason for it to swap. That's why I bought that much RAM in the first place.

But that's just a bandaid for now. Apple should fix the swap behavior to only swap when it's actually needed. Memory compression and dropping caches should be preferred over excessive swapping.
Make sense, disabling swap is long known to work on Intel, as to M1 I was not certain due to novel unified memory architecture ... hope that will serve as a proof that the bug is in VM, and fixable on the OS level.

P.S. As a bonus it does feel a tad snappier, since kernel_task is not torturing SSD anymore.
 
  • Like
Reactions: k-hawinkler

IceStormNG

macrumors 6502a
Sep 23, 2020
517
676
Yes, I understand that difference. What I was trying to ask is - does Activity monitor and smartmontools report same numbers over same period of time? Did anyone check?
Theoretically they should.
But: Activity Monitor als tracks I/O to external disks. smartmontools reads the report from each disk separately.
 

ambient_light

macrumors member
Feb 23, 2021
59
65
How do you disable and enable swapping in Terminal? TIA.
What eventually worked on my M1/Big Sur 11.3 Beta:

  1. Boot into the recovery mode
  2. From the Terminal, Disable System Integrity Protection (SIP) via csrutil disable
  3. Add boot args NVRAM parameter for VM no-swap mode 2 using command :
    nvram 40A0DDD2-77F8-4392-B4A3-1E7304206516:boot-args="vm_compressor=2"
  4. Enable back SIP via csrutil enable
  5. reboot
After the reboot, you could check that parameters worked by sysctl -a vm.compressor_mode, it should return 2 (no swap), instead of default 4.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.