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

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Hey All, Can someone tell me if the cached files under memory is something to worry about. It is sitting so high even after I cleared the cache. I also noticed while using Parallels desktop for Windows 11, the system started using swap memory. Its the Base model M2 Max Mac Studio with 32G Memory.


Screenshot 2023-08-13 at 3.31.57 PM.png
 

DeltaMac

macrumors G5
Jul 30, 2003
13,749
4,572
Delaware
You are not using Swap at all at that time.
The memory pressure graph is almost not there.
Memory is there for the system to use it.
You can watch that Activity Monitor, particularly if you are using a Windows system running in a VM (similar to how Parallels works). If you see that memory pressure graph start to fill up that little window, then turn yellow, then red - you could be legitimately concerned, but, then you should also watch for actual affects from high memory usage, such as noticeable lag/general poor response from your system in actual use. Not much going on? Smooth operation? video performing normally.
That memory pressure graph is red, and filling the box? Everything slows down? There's when you should have a look at what is causing that.
 

ArkSingularity

macrumors 6502a
Mar 5, 2022
928
1,130
Cached files are, for all intents and purposes, free memory. I don't want to get too technical here (I can explain more if anyone is curious), but essentially, Mac OS is going to try to fill unused RAM with anything that it can cache in order to try to make the best use of it, but it will just start purging the cache once the RAM is actually needed for something more important.

You don't want to purge the cache manually, it contains a lot of pages from the disk (cached files) that belong to applications you might have opened recently, or might open in the future, etc. Mac OS will manage all of that for you, it will clear it out any time it needs to and there is no action that is required from you. In fact, trying to clear it manually yourself might actually worsen performance rather than helping it.

Also, memory pressure generally is a much better figure to look at than the actual "memory used" number on Mac OS. This is because MacOS is a bit weird with the way it manages memory and can be confusing with the way it reports usage (it can make it appear that the system is more memory starved than it actually is). Memory pressure usually gives you a much clearer picture of what's actually going on.

- Green memory pressure means you have plenty of memory available and are nowhere near your limit (no matter what Activity monitor says with regards to "in use memory").
- Yellow means you're getting closer to your limit. You still have memory available, but MacOS has made this possible by compressing and swapping data more aggressively. Most workloads generally still run fine in the yellow.
- Red means you do not have enough memory for the workload you are running, and your system will have major performance slowdowns.

Apple's support pages have some good documentation on some of this as well:
- Memory Pressure
- Activity Monitor RAM reporting
 
Last edited:

Basic75

macrumors 68020
May 17, 2011
2,071
2,428
Europe
Clearing the Safari cache (which is what I'm guessing you did, the one that caches assets downloaded by the browser on disk) has nothing to do with the operating system's file or buffer cache (which caches recently accessed files in memory) except for cached assets being files, too, but that's not what this is about.

Having 16GB of cached files and no memory pressure is a good thing, you have enough RAM and the OS is keeping a lot of recently accessed data in memory, your computer should feel very fast and snappy and continue to do so for the next couple of years unless you start using some heavy hitting professional applications.

@ArkSingularity Can one even manually clear the operating system's buffer cache? I know of sync(8), but that only flushes pending writes, nothing more.
 

Feek

macrumors 65816
Nov 9, 2009
1,379
2,042
JO01
Walls of text above.

The only thing in that graph worth looking at is the memory pressure. Yours is very low and green.

Forget everything above it. Only start even thinking about getting concerned is if it goes high and red.
 
  • Like
Reactions: Surenmunoo

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Thanks all, gives me some assurance. Any idea why when using the parallels desktop for windows 11 the Studio would have used about 25mb of memory using memory swap? I know it's a small amount but I am just curious as to why.
 

ewu

macrumors regular
Apr 14, 2020
113
74
virtual machine always use a lots of cached memory, if you are using virtual machine, it is expected behavior.
 

ArkSingularity

macrumors 6502a
Mar 5, 2022
928
1,130
@ArkSingularity Can one even manually clear the operating system's buffer cache? I know of sync(8), but that only flushes pending writes, nothing more.
Third party tools can do it (typically by allocating large amounts of memory at once, forcing the operating system to release it). I don't know of any GUI tools built into Mac OS that will do it (aside from command line tools that are available to test memory stuff, but I don't think those count).
 

ArkSingularity

macrumors 6502a
Mar 5, 2022
928
1,130
Thanks all, gives me some assurance. Any idea why when using the parallels desktop for windows 11 the Studio would have used about 25mb of memory using memory swap? I know it's a small amount but I am just curious as to why.
Some amount of swap usage is normal, even on systems with a lot of memory. Some people have even noticed this on 64GB systems (where they will use small amounts of swap in certain workloads despite showing a lot of memory free).

It can be for a variety of reasons, but usually it's nothing to worry about unless you have several gigabytes worth of swap usage. MacOS always swaps out the data that is the least recently accessed first, and it won't actually move that data back into RAM until something actually needs it again. So stuff that ends up in swap can often stay there for quite a while.

If it's just hanging out in swap and sitting there for a while, it's because it's not really being used, so it's not hurting performance in any way.
 

Fishrrman

macrumors Penryn
Feb 20, 2009
29,175
13,223
Here's another way to "take care of swap" (once and for all):

First, you need enough RAM.
Secondly, you need to be that kind of user who is aware of how much RAM is being used.

What I did:
I DISABLED VM disk swapping using the terminal.
Easy to do.

Now, NO swapping at all.
The OS can't do it.

I've been running [first] my 2012 Mini like this, and [secondly] my 2018 Mini like this, and now my 2021 MacBook Pro 14" like this, too.

All work great and they have no RAM-related crashes.
But I close apps that don't need to be running, and I use NO Safari "tabs" at all -- not a single one.
But again, NO disk swapping -- at all, ever again!
 
  • Sad
  • Like
Reactions: Feek and Surenmunoo

TechnoMonk

macrumors 68030
Oct 15, 2022
2,551
4,026
Exhibit A:

cxncWZv.png


Am I concerned? Not even slightly.
Yours looks better. Mine is showing 52 GB memory used. Memory pressure is all green though.
Screen Shot 2023-08-13 at 12.04.19 PM.png

Here's another way to "take care of swap" (once and for all):

First, you need enough RAM.
Secondly, you need to be that kind of user who is aware of how much RAM is being used.

What I did:
I DISABLED VM disk swapping using the terminal.
Easy to do.

Now, NO swapping at all.
The OS can't do it.

I've been running [first] my 2012 Mini like this, and [secondly] my 2018 Mini like this, and now my 2021 MacBook Pro 14" like this, too.

All work great and they have no RAM-related crashes.
But I close apps that don't need to be running, and I use NO Safari "tabs" at all -- not a single one.
But again, NO disk swapping -- at all, ever again!
Mac OS keeps/swaps not immediately/recently used cache on the disk. I like it, as I load some heavier Apps, it’s much faster. I don’t see any advantage to disable it. I sometimes wish Apple used some other word for disk swap.
 
Last edited:

TechnoMonk

macrumors 68030
Oct 15, 2022
2,551
4,026
Thanks all, gives me some assurance. Any idea why when using the parallels desktop for windows 11 the Studio would have used about 25mb of memory using memory swap? I know it's a small amount but I am just curious as to why.
Depends if the App is trying to manage memory or the OS. Swap could also be an high water mark, where a fixed amount is allocated. Apple does move some of the content in RAM to swap. It can be very beneficial when the machine is under pressure for RAM, OS isn’t trying to move the content to swap and allocate the freed memory.
 
  • Like
Reactions: Surenmunoo

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Here's another way to "take care of swap" (once and for all):

First, you need enough RAM.
Secondly, you need to be that kind of user who is aware of how much RAM is being used.

What I did:
I DISABLED VM disk swapping using the terminal.
Easy to do.

Now, NO swapping at all.
The OS can't do it.

I've been running [first] my 2012 Mini like this, and [secondly] my 2018 Mini like this, and now my 2021 MacBook Pro 14" like this, too.

All work great and they have no RAM-related crashes.
But I close apps that don't need to be running, and I use NO Safari "tabs" at all -- not a single one.
But again, NO disk swapping -- at all, ever again!
What's the command to turn that off?
 

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Some amount of swap usage is normal, even on systems with a lot of memory. Some people have even noticed this on 64GB systems (where they will use small amounts of swap in certain workloads despite showing a lot of memory free).

It can be for a variety of reasons, but usually it's nothing to worry about unless you have several gigabytes worth of swap usage. MacOS always swaps out the data that is the least recently accessed first, and it won't actually move that data back into RAM until something actually needs it again. So stuff that ends up in swap can often stay there for quite a while.

If it's just hanging out in swap and sitting there for a while, it's because it's not really being used, so it's not hurting performance in any way.
Sorry for all the questions but I have one more. If I am booting from an external drive, a Samsung 990Pro, 2TB and the Mac uses Memory swap, is it using it from the internal ssd or the external one that I booted from.
 

ArkSingularity

macrumors 6502a
Mar 5, 2022
928
1,130
Sorry for all the questions but I have one more. If I am booting from an external drive, a Samsung 990Pro, 2TB and the Mac uses Memory swap, is it using it from the internal ssd or the external one that I booted from.
That's a good question. The swap file will be on the drive that the Mac is booted off of (unless you were to go in and manually change this with the command line). So if you were to boot off of an external drive, it will use that drive for swap.

16MB of swap is pretty much negligible though, MacOS is typically pretty opportunistic about trying to free up RAM early in case a lot of it is needed at once in the future. It doesn't necessarily mean your computer is running short on memory (if you're in the green, you have plenty of extra headroom and are nowhere near the limit). It's just MacOS trying to take the opportunity to clean things up when it can, since it doesn't know if some program is going to need a ton of memory suddenly in the future.

That kind of small swap usage is almost always just inactive stuff that is rarely accessed. You usually don't need to begin to be concerned until you see a few gigabytes of swap usage (and even then, if memory pressure is green, your system is still probably fine).
 

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
That's a good question. The swap file will be on the drive that the Mac is booted off of (unless you were to go in and manually change this with the command line). So if you were to boot off of an external drive, it will use that drive for swap.

16MB of swap is pretty much negligible though, MacOS is typically pretty opportunistic about trying to free up RAM early in case a lot of it is needed at once in the future. It doesn't necessarily mean your computer is running short on memory (if you're in the green, you have plenty of extra headroom and are nowhere near the limit). It's just MacOS trying to take the opportunity to clean things up when it can, since it doesn't know if some program is going to need a ton of memory suddenly in the future.

That kind of small swap usage is almost always just inactive stuff that is rarely accessed. You usually don't need to begin to be concerned until you see a few gigabytes of swap usage (and even then, if memory pressure is green, your system is still probably fine).
Thanks Mate, I am much more at ease now.
 
  • Like
Reactions: ArkSingularity

TechnoMonk

macrumors 68030
Oct 15, 2022
2,551
4,026
Thanks Mate, I am much more at ease now.
Enjoy the machine. Memory pressure is important. Unless you run in to consistent red memory pressure graph.
Sorry for all the questions but I have one more. If I am booting from an external drive, a Samsung 990Pro, 2TB and the Mac uses Memory swap, is it using it from the internal ssd or the external one that I booted from.
Just curious, are you gonna boot from external drive often? Why?
 

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
I bought 2 x Samsung 2TB drives to use in thunderbolt 4 cases and 512GB will not be enough for me (I shoot a lot of 5K drone videos and edit). 1 x Drive boots Sonoma and the other a copy of Ventura. I don't want to add too much wear on the internal ssd as well.
 

TechnoMonk

macrumors 68030
Oct 15, 2022
2,551
4,026
I bought 2 x Samsung 2TB drives to use in thunderbolt 4 cases and 512GB will not be enough for me (I shoot a lot of 5K drone videos and edit). 1 x Drive boots Sonoma and the other a copy of Ventura. I don't want to add too much wear on the internal ssd as well.
Unless you get a defective SSD, or very unlucky, it will likely outlast the life of your device. There is no wear and tear on SSD like those HDD. Did you test the speed? I use external drives too, but find it much faster to boot with internal drive, and access external drive.
 

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Unless you get a defective SSD, or very unlucky, it will likely outlast the life of your device. There is no wear and tear on SSD like those HDD. Did you test the speed? I use external drives too, but find it much faster to boot with internal drive, and access external drive.
The external drives take the same time as internal to boot up and is quite fast for what i do. I can transfer a 10G file between my 2 drives in less than a minute. I tested the speeds using Blackmagic and get around 2800 R/W speeds. I don't have any issues with the internal drive but i watched so many horrendous youtube videos about TBW and cannot replace the Silicone M.2 drives after they fail so i just want to play it safe. I also use an Asus Z790 ProArt with RX6950XT as my Hackintosh unit and with Hackintosh there is no worry about memory swap etc. The Studio works well and i might end up selling my Asus setup and my only concern was when using Parallel's for Windows 11.
 

Feek

macrumors 65816
Nov 9, 2009
1,379
2,042
JO01
I don't want to add too much wear on the internal ssd as well.
*sigh*

You are never going to use the life of the internal SSD. I demonstrated that with the figures from my iMac. Remember YouTube=click bait for doomsayers.

My Studio (which is over a year old) has a 2Tb SSD and I have about 600Gb free. When I look in DriveDX, it's showing Life Percentage Used of 0%. It's not even used 1% in a year and it's on for 8-10 hours/day during the week and more at weekend.

Ignore the negativity on YouTube, they have to say bad stuff to get your clicks to make money. Make life easy for yourself and boot off the internal SSD.
 
  • Like
Reactions: chabig

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
*sigh*

You are never going to use the life of the internal SSD. I demonstrated that with the figures from my iMac. Remember YouTube=click bait for doomsayers.

My Studio (which is over a year old) has a 2Tb SSD and I have about 600Gb free. When I look in DriveDX, it's showing Life Percentage Used of 0%. It's not even used 1% in a year and it's on for 8-10 hours/day during the week and more at weekend.

Ignore the negativity on YouTube, they have to say bad stuff to get your clicks to make money. Make life easy for yourself and boot off the internal SSD.
😁 I hear you. I blame my kids for getting sucked into YouTube
 

ArkSingularity

macrumors 6502a
Mar 5, 2022
928
1,130
I bought 2 x Samsung 2TB drives to use in thunderbolt 4 cases and 512GB will not be enough for me (I shoot a lot of 5K drone videos and edit). 1 x Drive boots Sonoma and the other a copy of Ventura. I don't want to add too much wear on the internal ssd as well.
Samsung SSDs are known to be pretty reliable. I can't speak for everyone who has ever owned one, but I've bought multiple Samsung drives over the years and never have once had a single one fail. I've had other SSDs fail, but not ones made by Samsung (just anecdotal experience, take it with a grain of salt. But I've put some of them through a LOT of abuse.)

Also, the larger the SSD, the longer its lifespan will be in terms of its ability to take a lot of writes. The SSD's controller has wear leveling stuff built in, so if you were to keep writing the same file over and over again in the same place, the controller would actually move that data physically on the SSD to different locations on the flash each time (even though it wouldn't move in your filesystem, so it would still be in the same place as far as the operating system is concerned). The larger the capacity of the drive, the more flash there is to spread writes around to, so larger drives can withstand more lifetime writes than smaller drives can.

Those 2TB Samsung drives can take a LOT of abuse. You could put that thing through constant 30GB of swap usage all day every day and probably still not wear out that drive. Those things are likely going to be able to take petabytes of writes before the wear out (an incomprehensibly large amount of data for these kinds of workloads). Of course, still back up your data just in case, but I wouldn't worry about impending failure on these, I think your drives will far outlast the computer that you're using.

(Those TBW rating numbers tend to be underestimated for a lot of SSDs. Samsung drives have been known to far outlast their official TBW ratings in various independent tests.)
 
Last edited:
  • Like
Reactions: Surenmunoo

Surenmunoo

macrumors member
Original poster
Oct 13, 2019
77
52
New Zealand
Samsung SSDs are known to be pretty reliable. I can't speak for everyone who has ever owned one, but I've bought multiple Samsung drives over the years and never have once had a single one fail. I've had other SSDs fail, but not ones made by Samsung (just anecdotal experience, take it with a grain of salt. But I've put some of them through a LOT of abuse.)

Also, the larger the SSD, the longer its lifespan will be in terms of its ability to take a lot of writes. The SSD's controller has wear leveling stuff built in, so if you were to keep writing the same file over and over again in the same place, the controller would actually move that data physically on the SSD to different locations on the flash each time (even though it wouldn't move in your filesystem, so it would still be in the same place as far as the operating system is concerned). The larger the capacity of the drive, the more flash there is to spread writes around to, so larger drives can withstand more lifetime writes than smaller drives can.

Those 2TB Samsung drives can take a LOT of abuse. You could put that thing through constant 30GB of swap usage all day every day and probably still not wear out that drive. Those things are likely going to be able to take petabytes of writes before the wear out (an incomprehensibly large amount of data for these kinds of workloads). Of course, still back up your data just in case, but I wouldn't worry about impending failure on these, I think your drives will far outlast the computer that you're using.

(Those TBW rating numbers tend to be underestimated for a lot of SSDs. Samsung drives have been known to far outlast their official TBW ratings in various independent tests.)
Yeah, Samsung seems to last. I have 2 980 Pro and a Crucial P5 in my hackintosh that I was using frequently to edit my videos and the crucial failed after 2 years, was replaced by dealer though but the Samsungs are still going. I transfer lots of videos from my drone SD Cards to PC, then edit them, save and share so lots of writing especially videos shot in ProRes takes up lots of space.
 
  • Like
Reactions: ArkSingularity
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.