Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

leman

macrumors Core
Oct 14, 2008
19,521
19,678
Having no swap memory is better than having swap memory. That is what your RAM is for, not your SSD.

Also swap memory is not a workable solution as you will get out of memory errors.

Says who? What do you base it on? Are you a kernel developer with expert understanding of virtual memory management on modern hardware?

What you as an end user should care about is not swap usage (that’s just an implementation detail) but performance and memory pressure. As long as the later is green your machine operates as expected, no matter how much swap is used.
 
  • Like
Reactions: LFC2020

leman

macrumors Core
Oct 14, 2008
19,521
19,678
In theory this should be the pageOuts/s number, but it is possible that
- Darwin reports the compression of pages as pageouts (but such pages do not go to flash of course)
- Apple Silicon uses a different algorithm for page compression (likely hardware accelerated), and so is willing to be more aggressive about page compression.

Not to mention that loading an app literally counts as page outs since the OS has to load the memory mapped image from the SSD.
 

torncanvas

macrumors regular
Feb 14, 2006
121
73
On youtube some people opened the inside of the Mac Mini and it is a very small package. So given the limited space Apple had to work it, it is likely that there was no space to put more memory in.

There is a ton of unused space in the M1 Mac Mini, and previous models had upgradable components in the same sized case.

Learning a little about Small Form Factor PC building, where just millimeters of space can make a big difference, I get the sense that the Mac Mini could easily be 1/2 the volume it is now without sacrificing thermals, if not 1/3 (Linus the YouTuber had a similar reaction in his teardown). Which means given the same space, it could be capable of much more in terms of features.

Case in point, you can now fit the highest end consumer CPUs and GPUs at 750W into a case as small as 12 liters, air cooled and without sacrificing performance, and below 40 dB at load.
 

UBS28

macrumors 68030
Oct 2, 2012
2,893
2,340
There is a ton of unused space in the M1 Mac Mini, and previous models had upgradable components in the same sized case.

Learning a little about Small Form Factor PC building, where just millimeters of space can make a big difference, I get the sense that the Mac Mini could easily be 1/2 the volume it is now without sacrificing thermals, if not 1/3 (Linus the YouTuber had a similar reaction in his teardown). Which means given the same space, it could be capable of much more in terms of features.

Case in point, you can now fit the highest end consumer CPUs and GPUs at 750W into a case as small as 12 liters, air cooled and without sacrificing performance, and below 40 dB at load.

Indeed. That is why I believe there will be an additional Mac Mini upgrade next year that will have a bigger M-chip. I am guessing it will be 12-core M chip that will also go into the 16” MBP.

I hope they won’t make the Mac Mini smaller instead.
 

Superhai

macrumors 6502a
Apr 21, 2010
735
580
Having no swap memory is better than having swap memory. That is what your RAM is for, not your SSD.

Also swap memory is not a workable solution as you will get out of memory errors.
There is a reason that smart and professional users who knows what they talk about say that you should have and use swap space.

1) If you don't use swap space and you run out of memory, the OS have only two options: instantly kill an app or crash.
2) Lot's of software need to store a lot of data which is not needed often, and you don't want it stored in your expensive RAM. Often programmers specifically make their apps optimised to what should and not should be swapped. And guess what, some software which don't use a lot of RAM or swap will instead use your SSD for temporary storage instead.
3) Modern CPU's and therefore all modern OS are optimised to virtual memory, and having a decent amount of swap space ensures they run smoothly. When an app launches it receives its own full address space, and a bit simply speaking it doesn't know and doesn't have to know how much other software is using. Memory pages that are empty will only be allocated when the app actually need them.

It is nothing wrong running without swap, but only in a few special cases is it better than having swap. And if you know you have those use cases, because how OS works it may be better to actually use swapping to a RAM disk or similar.

A good citation from Linux.com: 'Kernel maintainer Andrew Morton has said that he runs his desktop machines with a swappiness of 100, stating that “My point is that decreasing the tendency of the kernel to swap stuff out is wrong. You really don’t want hundreds of megabytes of BloatyApp’s untouched memory floating about in the machine. Get it out on the disk, use the memory for something useful.”'

(Swappiness of 100 in linux means swap as much as possible.)
 
  • Like
Reactions: torncanvas

leman

macrumors Core
Oct 14, 2008
19,521
19,678
There is a reason that smart and professional users who knows what they talk about say that you should have and use swap space.

1) If you don't use swap space and you run out of memory, the OS have only two options: instantly kill an app or crash.
2) Lot's of software need to store a lot of data which is not needed often, and you don't want it stored in your expensive RAM. Often programmers specifically make their apps optimised to what should and not should be swapped. And guess what, some software which don't use a lot of RAM or swap will instead use your SSD for temporary storage instead.
3) Modern CPU's and therefore all modern OS are optimised to virtual memory, and having a decent amount of swap space ensures they run smoothly. When an app launches it receives its own full address space, and a bit simply speaking it doesn't know and doesn't have to know how much other software is using. Memory pages that are empty will only be allocated when the app actually need them.

It is nothing wrong running without swap, but only in a few special cases is it better than having swap. And if you know you have those use cases, because how OS works it may be better to actually use swapping to a RAM disk or similar.

A good citation from Linux.com: 'Kernel maintainer Andrew Morton has said that he runs his desktop machines with a swappiness of 100, stating that “My point is that decreasing the tendency of the kernel to swap stuff out is wrong. You really don’t want hundreds of megabytes of BloatyApp’s untouched memory floating about in the machine. Get it out on the disk, use the memory for something useful.”'

(Swappiness of 100 in linux means swap as much as possible.)

To add to your great list of reason to use swap: the OS might be using swap to optimize application launch. If the system detects that you routinely start copies of a certain app, it might be cheaper to swap out cleanly loaded app state abs use that to start subsequent app copies rather than do it from zero every single time.

The point is: we don’t even know what Apple is doing to optimize virtual memory management. I’d expect them to aggressively employ machine learning to detect your app launch habits and predict memory requirements. Swap is an essential part of the system and being afraid of it is similar to “doctor, help, my heart rate goes up when I jog!”
 

Superhai

macrumors 6502a
Apr 21, 2010
735
580
To add to your great list of reason to use swap: the OS might be using swap to optimize application launch. If the system detects that you routinely start copies of a certain app, it might be cheaper to swap out cleanly loaded app state abs use that to start subsequent app copies rather than do it from zero every single time.
Speaking of, I remember from my early days and when Windows started using Prefetch for this purpose, there was so much misinformation going around the internet on how to use it, including regularly deleting the prefetch files.

It seem like virtual memory still is difficult to grasp around, and I gladly admit that I find it heavy, but therefore seeds ground for blanket statements that are plain wrong.
 

raknor

macrumors regular
Sep 11, 2020
136
150
Having no swap memory is better than having swap memory. That is what your RAM is for, not your SSD.

Also swap memory is not a workable solution as you will get out of memory errors.
That’s completely wrong, please stop!
 

UBS28

macrumors 68030
Oct 2, 2012
2,893
2,340
If that were true, virtual memory never would have been invented. Do you think every computer scientist in the last 50 years has been stupid?

Because RAM was super expensive 40 years ago. Virtual memory was introduced to allow computers to run with less memory.

RAM is much faster than virtual memory so you should always buy enough memory.
 
Last edited:

hugodrax

macrumors 65816
Jul 15, 2007
1,225
640
Lifespan and performance not the same thing ? everything natural or unnatural degrades with usage.

yet My mac Mini is as fast as the day I bought it. I have zero concerns with SSD longevity or performance after seeing a 2012 SSD get hit hard with usage and 24/7 operation. I could only imagine how much better the modern SSDs are in regards to reliability.
Another note, 8 years of in place OSX Upgrades ans no issues. A windows desktop would never cut it when it comes to that kind of reliability.
 

hugodrax

macrumors 65816
Jul 15, 2007
1,225
640
Because RAM was super expensive 40 years ago. Virtual memory was introduced to allow computers to run with less memory.

RAM is much faster than virtual memory so you should always buy enough memory.

Wrong, virtual memory was invented so programmers did not have to worry about creating and managing memory overlays. When virtual memory was invented it allowed whats called memory abstraction model, programmers no longer having to worry about managing memory via onerous memory overlays.
 

leman

macrumors Core
Oct 14, 2008
19,521
19,678
Because RAM was super expensive 40 years ago. Virtual memory was introduced to allow computers to run with less memory.

That's like saying that cars were invented so that you don't have to carry your grocery bags in your hands.

RAM is much faster than virtual memory so you should always buy enough memory.

RAM is just one component of (physical implementation of) virtual memory, so talking about "faster" in this context is misleading.

You should buy as much RAM as your workloads demand. Swapping behavior depends on memory management heuristics employed by the OS and can occur regardless of how much RAM you have. Getting more RAM just because you are afraid of swapping is silly.
 

leman

macrumors Core
Oct 14, 2008
19,521
19,678
They’re not “wrong”, the two statements aren’t even contradictory...

Except one of these statements is simplistic and misleading. Virtual memory is so much more than just RAM provision management. It's security, IPC, hardware I/O and many other things.
 

bb_mac

macrumors member
Jul 22, 2005
57
34
You don’t want swap memory with SSD’s and flash storage because it will kill it in the end.
*sigh* - this just keeps on being trotted out like gospel.

Yes, it will, but it will take YEARS - there's been plenty of experiments done here.
Even 5 years back, it took over 2 petabytes of data writes to kill an SSD - that's 2 million gigabytes of data.
Yep, not all SSD's would do that - and this was a lab test, rather than real world.
I think most SSD's are rated for about 1/2 a petabyte of writes - a cautious estimate.

So, even if the swap space ate up a combined total of 1000gb writes every day, it would be 2000 days or 5 and half years before you killed the drive with swap space alone, assuming the 2 petabytes of writes held true.
Even if it didn't and you somehow managed to write that much data a day, you would still get about a year and a half on the cautious life span estimate.

Good luck with writing 1000gb of swap space a day.

You can literally bombard that SSD with data 24/7 for years and years.

Heck, I've got 6 year old SSD drives that are good as new - still in operation.
I've used them for gaming, for graphics, for music production, for video.
They all still work just fine.
They've been wiped numerous times, had multiple operating systems slapped on them, used for boot disks - it takes a LOT to kill an SSD with data writes.

By the time you've killed an SSD drive, you will have replaced it anyway.

It's the equivalent of installing a new OS that takes up all the space on a 500gb drive 4000 times in ideal lab conditions, or 1000 times with the general write ratings given to SSD's.
Sure, this is a simple example and it is more complicated than that, but please stop trotting out this tired old rubbish about "killing an SSD with swap" - for 99% of users, the chances of killing an SSD within 5 years are pretty much nil.
 
Last edited:
  • Like
Reactions: Sanpete

acidfast7_redux

Suspended
Nov 10, 2020
567
521
uk
I'm not sure why people have a fixation on this.
This isn't 2012. SSDs have evolved. Swap usage won't kill a SSD. It's part of the functioning of the computer.
I killed 2 SSDs on my 2013 rMBP. After this second one **** the bed, I upgraded to an M1 MBP.

Let's hope this "SSD" works better.
 

syngress

macrumors newbie
Jan 30, 2021
22
10
Poland Cracow
I work on 13", M1, 2020 MacbookPro with 512GB SSD and 16GB DDR4

RAM usage 2GB / SWAP usage 7GB

Zrzut ekranu 2021-04-7 o 12.33.07.png


For some reason hardware is using SSD all the time.
Regardless of how durable the SSD chips are used by Apple, this is a deliberate reduction in SSD lifespan.

What is the purpose of carving an SSD by SWAP, with enough free RAM on board ?
 

leman

macrumors Core
Oct 14, 2008
19,521
19,678
For some reason hardware is using SSD all the time.
Regardless of how durable the SSD chips are used by Apple, this is a deliberate reduction in SSD lifespan.

For this statement to be true, you have to demonstrate that any noteworthy lifespan reduction is actually taking place. Even most extreme user reports so far would place expected SSD lifespan at over 10 years, which would be far beyond average life of consumer storage media.

Besides, Apple must be confident that endurance is not a problem with their SSDs. If these machines start dying in bulk three years down the road, they will be hit with an extremely costly class action lawsuit.
 

syngress

macrumors newbie
Jan 30, 2021
22
10
Poland Cracow
For this statement to be true, you have to demonstrate that any noteworthy lifespan reduction is actually taking place. Even most extreme user reports so far would place expected SSD lifespan at over 10 years, which would be far beyond average life of consumer storage media.

Besides, Apple must be confident that endurance is not a problem with their SSDs. If these machines start dying in bulk three years down the road, they will be hit with an extremely costly class action lawsuit.

You are right, but it cannot be denied that ssd usage is greater and there is one more issue, the speed of access to data from SWAP. I assume that the problem is application that is not native and translated by Rosetta ..
So we have two problems, data access speed and SSD usage.
 

Toutou

macrumors 65816
Jan 6, 2015
1,082
1,575
Prague, Czech Republic
For some reason hardware is using SSD all the time.
Regardless of how durable the SSD chips are used by Apple, this is a deliberate reduction in SSD lifespan.
I don't think that's deliberate, looks like a bug to me.

Currently I have all my work stuff up and running (Safari, Firefox, Sublime Text, two instances of Ruby Mine, MariaDB, Puma, Terminal, Signal and Spotify), with 12 GB used out of 16, memory pressure in green and 91 MB of swap.
 

leman

macrumors Core
Oct 14, 2008
19,521
19,678
You are right, but it cannot be denied that ssd usage is greater and there is one more issue, the speed of access to data from SWAP. I assume that the problem is application that is not native and translated by Rosetta ..
So we have two problems, data access speed and SSD usage.

Does it mean that you are experiencing performance issues of any kind?

I think there is little doubt that these new Macs use swap differently (more aggressively) than Intel Macs, but there still are so many unclear things… does high swap usage means that things are being actively paged out or is swap simply accumulated? Is it a bug? What are the actual VM statistics?

Next time you se this high swap use, please run vm_stat in the terminal. It could offer some insight.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.