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

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
I have a question about swap usage.

Let's say your computer shows that it is using 1GB of swap. Seems normal.

But you're not writing 1GB of swap every minute, correct? It's just a 1GB area of your SSD that has now been allotted for swap. Yes there will be some writes to that space... but also a lot of reads from that space too.

It seems like people are getting bent out of shape whenever they see their computer using swap thinking "ZOMG my SDD is getting continually damaged by swap!!!"

If writing to an SSD is damaging... wouldn't a photographer copying 50GB of photos to an SSD every week be more damaging than a swap file? Or if you're streaming a movie on Netflix... the data is still being written to the SSD as you watch the movie. That's at least 1GB per hour. Isn't that more damaging than a swap file?

Macs with SSDs have been around for a long time... and all Macs use some amount of swap space. But I'm unaware of Mac SSDs failing from swap overuse.

I have a Late 2009 iMac with a 1 TB HDD. When it swaps, it is noticeable. So I maxed the RAM and it runs fine now.

If you want the best experience, now or ten years from now, why wouldn't you want to ensure the best performance?

SWAP is generally used to push a program to storage when it isn't used, so it would be swapped back in when you go to use it.
 

Michael Scrip

macrumors 604
Mar 4, 2011
7,975
12,674
NC
My Samsung 970 Pro 512 GB has 12.7 TB written to it over 2.5 years time (I bought it in June 2018)

Wow! So you write roughly 5 TB per year to that drive... and that drive is rated for 600 TBW.

That's 120 years. I think you're in good shape! ?

Is that a boot/swap drive? Or just storage?

I think the general takeaway here is that SSDs can last a looong time. People probably don't need to be worried about swap ruining their SSDs. They likely won't be using this same M1 Mac in 15 or 20 years... :p
 
  • Like
Reactions: Never mind

Michael Scrip

macrumors 604
Mar 4, 2011
7,975
12,674
NC
I have a Late 2009 iMac with a 1 TB HDD. When it swaps, it is noticeable. So I maxed the RAM and it runs fine now.

If you want the best experience, now or ten years from now, why wouldn't you want to ensure the best performance?

SWAP is generally used to push a program to storage when it isn't used, so it would be swapped back in when you go to use it.

Oh I agree completely! If I buy an M-series Mac I will definitely go for 16GB.

We know SSDs have a limited lifespan for writes.

I was just wondering how much damage a swap file might cause. Though it doesn't sound like it should be a big concern. :)
 

mo5214

macrumors regular
Sep 20, 2019
145
102
Wow! So you write roughly 5 TB per year to that drive... and that drive is rated for 600 TBW.

That's 120 years. I think you're in good shape! ?

Is that a boot/swap drive? Or just storage?

I think the general takeaway here is that SSDs can last a looong time. People probably don't need to be worried about swap ruining their SSDs. They likely won't be using this same M1 Mac in 15 or 20 years... :p

It was my main drive until October 2019. (in which I switched to 1TB Sabrent Rocket, and then 2TB Samsung 970 evo plus just 3 months ago)

So that amount might be just over 1 year period.

But keep in mind that Samsung drives are known have endurance.
840 Pro lasted 8000TBW in testing, and 850 Pro lasted 9100TBW.
But then again. Those are MLC SSDS. Newer SSDs are TLC-based, which might half that number.
Too bad reviewers don't really do endurance tests on newer SSDs anymore (at least I can't find any)
 

alien3dx

macrumors 68020
Feb 12, 2017
2,193
524
I have a question about swap usage.

Let's say your computer shows that it is using 1GB of swap. Seems normal.

But you're not writing 1GB of swap every minute, correct? It's just a 1GB area of your SSD that has now been allotted for swap. Yes there will be some writes to that space... but also a lot of reads from that space too.

It seems like people are getting bent out of shape whenever they see their computer using swap thinking "ZOMG my SDD is getting continually damaged by swap!!!"

If writing to an SSD is damaging... wouldn't a photographer copying 50GB of photos to an SSD every week be more damaging than a swap file? Or if you're streaming a movie on Netflix... the data is still being written to the SSD as you watch the movie. That's at least 1GB per hour. Isn't that more damaging than a swap file?

Macs with SSDs have been around for a long time... and all Macs use some amount of swap space. But I'm unaware of Mac SSDs failing from swap overuse.
my concern ram data in swap is compilation software and speed.My write. /read wouldn't exceed quota. If you do normal stuff okay.

1 minute to 5 not much for most people but if you keep compiling after change 100 times a day .Loss productivity.
 

rui no onna

Contributor
Oct 25, 2013
14,920
13,266
Where did you get those numbers? Would Apple really source a "High-end SSDS" in their Systems?

Here are some number of Samsung SSDs (Market leader for SSDs, in-house NANDS)

840 Pro (MLC) from 2015 test, lasted 2400 TBW+ (it didn't die) . Tho it is only rated 73 TBW in warranty.

Warrantied TBW for 970 PRO (MLC): 600 TBW for 512GB model, 1,200 TBW for 1TB model

Warrantied TBW for 970 EVO Plus (TLC): 150 TBW for 250GB model, 300 TBW for 500GB model, 600 TBW for 1TB model, 1,200 TBW for 2TB model.

The 1TB version of the SSD 980 Pro (TLC) is only rated for 600 TBW, vs 1,200 TBW on the 1TB SSD 970 Pro.

Here's some rated TBW from Sandisk's own extreme pro line

up to 300TBW for 512GB, up to 600 TBW for 1 TB, and up to 1200 TBW for 2 TB drives.

A Test post on reddit suggest they lasted around 2800 TBWs until they are done for.
While Samsungs SSD (850 pro 256 GB MLC in this case) lasted up to 9100 TBWs in testing (being rated for only 150 TBW)

Given that Apple is sourcing Sandisk for M1-based MBPs and MBAs, it is most likely to be a TLC.
if the numbers from Sandisk's own extreme NVMe SSD spec sheet, and third-party tests revolving it, and Apple's tendencies to source a "mid-range" part in their systems.

I'd say that those NANDs are most likely to be rated around "industry standard 1200 TBW" at the most as they are all using TLC NANDS now. And may not last beyond 3000 TBWs.

From that number you would only have 0.65(rated)/1.64(projected last) TB average quota per day over the 5 year period.

Depending on how much of a "power user" one is. It could be problematic. But at any rate, it is unlikely to be nowhere near that 10000 TBW you mentioned. unless they somehow source the most premium Samsung NANDs in their next Hardware Revisions. Which is unlikely as M1 Macs are lower-end machines (or at least are targeted as such).


EDITED 2-3 times for more info.

Link:







SSD endurance ratings includes controller, over-provisioning and write amplification. Apple uses their own storage controller inside the M1 SoC paired with raw NAND flash.

If you're looking at raw NAND writes, that's around 3,000 P/E cycles for 3D TLC.

It would be interesting to see if there's a wear leveling count attribute in S.M.A.R.T. and how it's affected based on host writes. DriveDX reports host writes of 700+ GB for my 8/512 MBA but raw value for the lifespan attribute still shows 0 when WLC should be at least 1 after a full drive write.
 

Michael Scrip

macrumors 604
Mar 4, 2011
7,975
12,674
NC
But then again. Those are MLC SSDS. Newer SSDs are TLC-based, which might half that number.

True... but half of a very long time is still a really long time... :p

Thanks for sharing your experience!

In your opinion... do you think people should be freaking out about Apple SSD endurance? As I said before... Macs with SSDs and only 8GB of RAM have been around for a long time. But I don't recall hearing stories of those SSDs dying from simply wearing out.
 

OldMike

macrumors 6502a
Mar 3, 2009
537
219
Dallas, TX
True... but half of a very long time is still a really long time... :p

Thanks for sharing your experience!

In your opinion... do you think people should be freaking out about Apple SSD endurance? As I said before... Macs with SSDs and only 8GB of RAM have been around for a long time. But I don't recall hearing stories of those SSDs dying from simply wearing out.

I think it really depends on how it is used. In a previous post in this thread, @thinkingBanana reported this usage on his internal SSD due to swap on his 8GB RAM M1:

30GB / day with no usage
230GB / day with intense web browsing
1.2TB written for 3 hours usage of Xcode

Obviously the 1.2TB written with 3 hours of Xcode usage is very troubling, even if you take the 150TBW endurance rating on the 250GB SSD out to 1000TBW actual lifespan.
 

Michael Scrip

macrumors 604
Mar 4, 2011
7,975
12,674
NC
Obviously the 1.2TB written with 3 hours of Xcode usage is very troubling, even if you take the 150TBW endurance rating on the 250GB SSD out to 1000TBW actual lifespan.

Yikes! Yeah that seems troubling! :oops:

If that Mac had 16GB of RAM... I wonder if it would use a smaller amount of swap... or perhaps no swap at all?

Does anyone use XCode on a 32GB Intel Mac? I wonder what their swap usage is.
 

Ethosik

Contributor
Oct 21, 2009
8,142
7,120
Storage isn't as important with the cloud and with NAS. Setting one up also means that I don't need to duplicate files on multiple devices. I used to buy more storage with mobile devices but it's mostly unused now.
I agree. I got a 1TB drive and that is plenty for me with all the software I want to install. But my actual work is stored on several 2 TB Samsung T5, 24TB NAS, several 8TB external HDDs.
 

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
Yikes! Yeah that seems troubling! :oops:

If that Mac had 16GB of RAM... I wonder if it would use a smaller amount of swap... or perhaps no swap at all?

Does anyone use XCode on a 32GB Intel Mac? I wonder what their swap usage is.

You could probably reduce swap with fewer parallel compiles but then you wouldn't be maxing out the CPU.

I did a Firefox build on a Windows machine and it maxed out a Core i7 but the system has 48 GB so no swapping at all.

I don't know how many processes are running by default for Firefox - maybe it does one process per core or thread. If you were RAM constrained, though, it would be the worst possible case. You'd swap out one compile, swap in the next, compile, swap it out, swap in the next one, etc.
 
  • Like
Reactions: Michael Scrip

richinaus

macrumors 68020
Oct 26, 2014
2,432
2,186
Clearly you can’t understand what I’m trying to explain. You’re comparing an AIO to a workstation saying one has a newer CPU. Maybe if you asked for advice you wouldn’t be trading in your iMac now.
I know what you are saying.
I have gone through ado many computer types and a full desktop has been the only one that meets my needs.
it is massively better than the iMac Pro I had, which was $3k more.....

an AIO is basically a glorified laptop.

a laptop is not a desktop replacement, as only a desktop can replace a desktop. And so on.

learnt my lessons the expensive way.
 

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
I know what you are saying.
I have gone through ado many computer types and a full desktop has been the only one that meets my needs.
it is massively better than the iMac Pro I had, which was $3k more.....

an AIO is basically a glorified laptop.

a laptop is not a desktop replacement, as only a desktop can replace a desktop. And so on.

learnt my lessons the expensive way.

I went through the same thing. Trying to run my setup with two MacBook Pro 15s. They both got hot. I built a desktop for $2K (about the price of a laptop), and it normally runs my workload at 26-39 degrees. It has several case fans and a monster of a heatsink and dual fans on top of the CPU. The goal of the system was to run at low temperatures, run efficiently and run silently.

And then the M1 came out. I'm looking forward to the M1X. I don't know which form factor will be right for me though. I have one application that doesn't run on Big Sur yet so I need that to get ported or I'd have to run a mixed Windows/M1X environment.
 

turbineseaplane

macrumors P6
Mar 19, 2008
17,412
40,223
And then the M1 came out. I'm looking forward to the M1X. I don't know which form factor will be right for me though

I struggle with that also

I love pure desktops, but the allure of going with one machine for all is very tempting now that Apple M's are doing things we only really dreamed about from a laptop form factor.
 
  • Like
Reactions: pldelisle

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
I struggle with that also

I love pure desktops, but the allure of going with one machine for all is very tempting now that Apple M's are doing things we only really dreamed about from a laptop form factor.

My biggest problem with the MacBook, Mini and iMac is heat. The M1X should resolve that. If I could get a Mini that could drive three 4k monitors and get 64 GB of RAM and run my programs, then I would be happy with that. At the moment, though, the iMac 27 looks like a better bet because you can put in 256 GB of RAM yourself in the Intel version. If the M1X has SoC RAM and allows DIMMs, then I'd go this route and it would most likely go in the iMac, Pro and possibly the Mini.

If it's the case that my one program won't run on Big Sur or M1 for a while, then I'd have to use Windows and macOS.
 
  • Like
Reactions: turbineseaplane

rui no onna

Contributor
Oct 25, 2013
14,920
13,266
I think it really depends on how it is used. In a previous post in this thread, @thinkingBanana reported this usage on his internal SSD due to swap on his 8GB RAM M1:

30GB / day with no usage
230GB / day with intense web browsing
1.2TB written for 3 hours usage of Xcode

Obviously the 1.2TB written with 3 hours of Xcode usage is very troubling, even if you take the 150TBW endurance rating on the 250GB SSD out to 1000TBW actual lifespan.

It should be noted that the drive health didn't seem to budge at all from 100% with those reported figures. It's very likely those numbers are inflated.

Even if you consider the 6.1/6.7TB reported by @thinkingBanana as using up 1% drive lifespan, that amounts to at least ~460 TBW.
 

Ethosik

Contributor
Oct 21, 2009
8,142
7,120
My biggest problem with the MacBook, Mini and iMac is heat. The M1X should resolve that. If I could get a Mini that could drive three 4k monitors and get 64 GB of RAM and run my programs, then I would be happy with that. At the moment, though, the iMac 27 looks like a better bet because you can put in 256 GB of RAM yourself in the Intel version. If the M1X has SoC RAM and allows DIMMs, then I'd go this route and it would most likely go in the iMac, Pro and possibly the Mini.

If it's the case that my one program won't run on Big Sur or M1 for a while, then I'd have to use Windows and macOS.
Do you anticipate a higher end Mac mini with an M1X? Honestly, I prefer Macs without screens. I have my own monitors and I prefer three monitors that are the same. Having the iMac screen and two other screens of different type irritates me. So I definitely prefer either the Mac Pro or Mac Mini. When things were Intel, Mac Mini seemed ridiculous to use and the Mac Pro was too expensive for what I need. I was thinking about getting the rumored Mac Pro Mini, but if the Mac Mini gets updated with the M1X and has 4x Thunderbolt ports that might be the highest system I would need. Even if I eventually get into 4K video editing with these M1 processors handling it so well.
 

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
Do you anticipate a higher end Mac mini with an M1X? Honestly, I prefer Macs without screens. I have my own monitors and I prefer three monitors that are the same. Having the iMac screen and two other screens of different type irritates me. So I definitely prefer either the Mac Pro or Mac Mini. When things were Intel, Mac Mini seemed ridiculous to use and the Mac Pro was too expensive for what I need. I was thinking about getting the rumored Mac Pro Mini, but if the Mac Mini gets updated with the M1X and has 4x Thunderbolt ports that might be the highest system I would need. Even if I eventually get into 4K video editing with these M1 processors handling it so well.

I run my Windows desktop with 3x4k Dell monitors and it's great. I'd love a Mac Pro M1X but there's a lot of stuff in the Intel Mac Pro that I don't need and the current iMac is a far better value for the performance than the Mac Pro if you don't need the high-end Mac Pro options. One other thing I like about the iMac is that they have pretty good speakers that don't take up space on the desk.

So we'll see what they come up with. I wouldn't mind replacing my 2014 MacBook Pro 15 with an M1X 14 inch MacBook Pro as well.
 

armoured

macrumors regular
Feb 1, 2018
211
163
ether
I have a Late 2009 iMac with a 1 TB HDD. When it swaps, it is noticeable. So I maxed the RAM and it runs fine now.

If you want the best experience, now or ten years from now, why wouldn't you want to ensure the best performance?
This is a good example in a different way though: you don't say what amount you maxed the RAM to, but it's entirely possible that you would have had better performance / improvements if you had switched the HDD out and replaced with an SSD.

Your larger amount of ram will reduce the amount of swapping in and out, but it cannot improve the slow read times especially for random access.

So yes - more ram good. But sometimes (depends on the specifics) the most severe bottleneck will not be ram or swapping - and improving throughput of other systems may give bigger benefits.

I'm pretty confident that this would actually be more noticeable for that imac than the ram upgrade - but it depends on use etc. Also ssds are nowhere near as expensive as they once were.

(I don't know the imac you have well i.e. do not know how hard to access internals - you could also hang an external ssd on that imac and get an improvement, although USB2.0 connectors would be a limitation; at any rate may not be worth it for a mac that old)
 

Jouls

macrumors member
Aug 8, 2020
89
57
for reference. My Samsung 970 Pro 512 GB has 12.7 TB written to it over 2.5 years time (I bought it in June 2018)
Is there an easy way apart from smartmontools or DriveDX how to check the TB written to my SSD? Thanks.
 

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
This is a good example in a different way though: you don't say what amount you maxed the RAM to, but it's entirely possible that you would have had better performance / improvements if you had switched the HDD out and replaced with an SSD.

Your larger amount of ram will reduce the amount of swapping in and out, but it cannot improve the slow read times especially for random access.

So yes - more ram good. But sometimes (depends on the specifics) the most severe bottleneck will not be ram or swapping - and improving throughput of other systems may give bigger benefits.

I'm pretty confident that this would actually be more noticeable for that imac than the ram upgrade - but it depends on use etc. Also ssds are nowhere near as expensive as they once were.

(I don't know the imac you have well i.e. do not know how hard to access internals - you could also hang an external ssd on that imac and get an improvement, although USB2.0 connectors would be a limitation; at any rate may not be worth it for a mac that old)

I went from 4 GB of RAM to 16 GB of RAM and it does not swap at all now.

I have tried using an external USB drive and an external Firewire drive and getting to 16 GB had had the best impact on performance. I have lots of spare SSDs but I'd have to buy a thermal sensor and it just isn't worth the effort. I only run cloud applications on this old iMac. It is cluster with a 2015 MacBook Pro 15 and a 2008 Dell XPS Studio 435mt which has a Core i7 and 48 GB of RAM. If something runs slow on the iMac, then I just run it on one of the other two systems which are far faster. But it's all old equipment. And lots of RAM means that this old equipment is still quite usable.
 
  • Like
Reactions: armoured

TrueBlou

macrumors 601
Sep 16, 2014
4,531
3,619
Scotland
This is a good example in a different way though: you don't say what amount you maxed the RAM to, but it's entirely possible that you would have had better performance / improvements if you had switched the HDD out and replaced with an SSD.

Your larger amount of ram will reduce the amount of swapping in and out, but it cannot improve the slow read times especially for random access.

So yes - more ram good. But sometimes (depends on the specifics) the most severe bottleneck will not be ram or swapping - and improving throughput of other systems may give bigger benefits.

I'm pretty confident that this would actually be more noticeable for that imac than the ram upgrade - but it depends on use etc. Also ssds are nowhere near as expensive as they once were.

(I don't know the imac you have well i.e. do not know how hard to access internals - you could also hang an external ssd on that imac and get an improvement, although USB2.0 connectors would be a limitation; at any rate may not be worth it for a mac that old)


You're spot on, I can tell you that from experience. My iMac is a late 2015 Retina 5K, in which I upgraded to 32GB of RAM, because before the M1 came along and made me question everything I know about how a system should run, that was the minimum RAM I need for my system to cope with my workload.

However, when I swapped from an old fashioned platter drive to an SSD, I saw immediate improvements to the overall speed of the system in a way I never had from adding more RAM. RAM is great for its intended purpose - temporarily storing data, but damn an SSD really makes a difference, get the fastest one you can and gaze in wonder at the improvement ;)

Even a Thunderbolt, or USB 3 SSD will make a difference to the system, I've got, well had, I'm not using the iMac anymore, extra OS installs on an external TB 2 SSD and one on a USB 3 SSD. Even those made the iMac considerably faster than when using the old spinning HDD.
 
  • Like
Reactions: armoured

TrueBlou

macrumors 601
Sep 16, 2014
4,531
3,619
Scotland
I went from 4 GB of RAM to 16 GB of RAM and it does not swap at all now.

I have tried using an external USB drive and an external Firewire drive and getting to 16 GB had had the best impact on performance. I have lots of spare SSDs but I'd have to buy a thermal sensor and it just isn't worth the effort. I only run cloud applications on this old iMac. It is cluster with a 2015 MacBook Pro 15 and a 2008 Dell XPS Studio 435mt which has a Core i7 and 48 GB of RAM. If something runs slow on the iMac, then I just run it on one of the other two systems which are far faster. But it's all old equipment. And lots of RAM means that this old equipment is still quite usable.


That would definitely make a noticeable difference, 4GB is quite low these days, you'd even have seen a difference at 8GB (though not as much). Once you start going above 16GB though, in my experience at least of going up to 32 and 64GB, the benefits are less immediately noticeable - until you're working on very large projects of course.
 
  • Like
Reactions: armoured

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
You're spot on, I can tell you that from experience. My iMac is a late 2015 Retina 5K, in which I upgraded to 32GB of RAM, because before the M1 came along and made me question everything I know about how a system should run, that was the minimum RAM I need for my system to cope with my workload.

However, when I swapped from an old fashioned platter drive to an SSD, I saw immediate improvements to the overall speed of the system in a way I never had from adding more RAM. RAM is great for its intended purpose - temporarily storing data, but damn an SSD really makes a difference, get the fastest one you can and gaze in wonder at the improvement ;)

Even a Thunderbolt, or USB 3 SSD will make a difference to the system, I've got, well had, I'm not using the iMac anymore, extra OS installs on an external TB 2 SSD and one on a USB 3 SSD. Even those made the iMac considerably faster than when using the old spinning HDD.

A Thunderbolt or USB 3 SSD won't make a bit of difference on a Late 2009 iMac. The only thing slow about the HDD is booting up and I never turn the computer off.
 

pshufd

macrumors G4
Oct 24, 2013
10,151
14,574
New Hampshire
That would definitely make a noticeable difference, 4GB is quite low these days, you'd even have seen a difference at 8GB (though not as much). Once you start going above 16GB though, in my experience at least of going up to 32 and 64GB, the benefits are less immediately noticeable - until you're working on very large projects of course.

I upgraded to 12 first, by adding 8 GB and it was still swapping so I went up to 16. Right now program + cache are about 14 GB. It is nice to cache all of the files that you use as you don't have to go to the disk at all to fetch data. I was hitting 16 GB of RAM use which is why I clustered this system with two other systems. The three systems together have 72 GB of RAM, 10 Cores, 2 SSDs and 1 HDD. The MacBook Pro also gets near 16 GB of RAM for programs and cache.

There is no downside to more RAM. Especially if you want longevity.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.