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

HaykD

macrumors newbie
Original poster
Aug 1, 2021
17
5
Hi! I see swap is used while there is about 35GB free RAM. Any explanation? Shouldn't it use free RAM first, then send the data to SSD?

1627806112531.png


iMac (Retina 5K, 27-inch, 2020)
3,8 GHz 8-Core Intel Core i7
72 GB 2133 MHz DDR4
AMD Radeon Pro 5500 XT 8 GB
 
You can TURN OFF VM disk swapping if you want.
I did it, with 16gb of RAM.
No problems.
 
  • Like
Reactions: HaykD
I'm pretty sure it's always going to put something in Swap. Regardless of the amount of free RAM. With the VM disk enabled. Probably services that never or rarely get used to free up RAM.
 
  • Like
Reactions: HaykD
I see swap is used while there is about 35GB free RAM. Any explanation? Shouldn't it use free RAM first, then send the data to SSD?

1627806112531.png
I don't see 35GB free. What I see is 72 - 37.39 - 34.49 = 0.12 GB free.

Looks pretty happy to me. Modest amount of compression; some long unused data pushed to the swap file; lots in cache; tiny amount of free memory.

Here is my iMac (nearly 6 days since booting):

Capto_2021-08-02_09-06-35_.png


I wish it would use Swap more often and have less Compressed. I prefer the swap/compressed balance on yours, but I am sure it just reflects a somewhat different workload.
 
Activity Monitor used to show page ins and page outs. Page outs are bad, page ins aren’t so bad. Code may be stored in the swap file and if memory is needed the code’s pages are reused without needing to write the pages to the swap since the code pages are immutable.
 
  • Like
Reactions: macsound1 and HaykD
iMac (Retina 5K, 27-inch, 2020)
3,8 GHz 8-Core Intel Core i7
72 GB 2133 MHz DDR4
AMD Radeon Pro 5500 XT 8 GB
Note that having 72GB of RAM means that you are either losing dual channel or your memory runs at 2133MHz instead of 2600MHz. See this post for more details.
 
  • Like
Reactions: HaykD
Note that having 72GB of RAM means that you are either losing dual channel or your memory runs at 2133MHz instead of 2600MHz. See this post for more details.
Thanks. I didn't really get what can be a solution. The RAMS installed are 2 Samsumg 32 GB and 2 original 4 GB. So if I replace the last ones and install 2 more Samsung 32 GB, will I get 2600mhz or not?
 
Yep, having 4 identical 32GB modules will ensure the 2600Mhz speed (and dual channel). You can also remove the 2 x 4GB from Apple to get the maximum speed out of your memory (but you will lose 8GB as a result).
 
  • Like
Reactions: HaykD
gilby wrote:
"That just leads to more compression (and decompression). Slows the system down more than does a little light use of the swap file. Don't turn off swapping unless there is a strong reason for doing so."

Nope.
Not in my experience.
And... I turn off "memory compression" as well.

I've been running this way FOR YEARS now.
My Macs run with no problems at all.

I'd suggest you try it yourself for 24-48 hours.
Then report back with your findings.
 
I would highly recommend against interfering and effectively messing with macOS's built-in highly sophisticated memory management, which is the result of 50+ years of UNIX experience, development, refinement, and optimization. There's a reason why modern UNIX/BSD, Linux and Windows operating systems handle available RAM the way they do, and there's a reason why they all behave very much alike these days.

However much smarter than the combined intelligence of thousands of engineers and developers refining this process over the course of five decades you think you may be the plain and simple truth is that you're not.
 
Last edited:
"However much smarter than the combined intelligence of thousands of engineers and developers refining this process over the course of five decades you think you may be the plain and simple truth is that you're not."

I'm not smarter than they are.
But through experience, and the willignness to experiment, I've found "what works" for me.

I reckon over the course of 37 years of using Macs, I've done well enough, probably better than most folks in this forum, insofar as having problems or requiring tech support goes.

Surely you remember when Apple offered you the option to run with or WITHOUT VM, your choice...?
Just because they discontinued that user option, doesn't mean it no longer works.
That's why terminal still offers it...
 
  • Like
Reactions: daniiv
Surely you remember when Apple offered you the option to run with or WITHOUT VM, your choice...?
Surely you remember that this choice was offered in macOS 9 and not macOS X, which had a completely different memory management unit and absolutely NOTHING to do with the current UNIX-based and BSD-derived macOS. Literally absolutely nothing. Zero. Zilch.

Quite frankly I don't really care what you do with your computers. What I do object to, however, is you giving people factually wrong and misleading advice. Disabing swap on a UNIX-derived system with either a BSD, a Darwin, or an Linux MMU is one of the if not the singular most stupid things you can quite possibly do.
 
"Disabing swap on a UNIX-derived system with either a BSD, a Darwin, or an Linux MMU is one of the if not the singular most stupid things you can quite possibly do."

Say what you wish.
It works for me -- actually, works VERY well.
(that is all...)
 
  • Like
Reactions: daniiv
Yep, having 4 identical 32GB modules will ensure the 2600Mhz speed (and dual channel). You can also remove the 2 x 4GB from Apple to get the maximum speed out of your memory (but you will lose 8GB as a result).

What if I remove 2 Apple 4GBs and add 1 identical to 2 other 32 GB Samsung RAM (so 1 slot will be empty)? Will speed be 2600Mhz speed (and dual channel)? Will this 96GB RAM work without issues?
 
What if I remove 2 Apple 4GBs and add 1 identical to 2 other 32 GB Samsung RAM (so 1 slot will be empty)? Will speed be 2600Mhz speed (and dual channel)? Will this 96GB RAM work without issues?
This will "work" in that it will run, but it will not be optimal. You will not have full dual channel. 64GB will run in dual channel, and 32 GB will run in single channel (i.e., effectively at half speed), as the third 32GB DIMM will not have a matching 32GB DIMM in the other channel.
If the three DIMMs are identical it should run at 2667 MT/s, but "identical" means exact same part number. If the iMac detects a different part number for the third stick the transfer speed will likely drop to 2133 MT/s.
For optimum memory speed you should have either one pair of DIMMs of the same size, or two pairs of identical DIMMS, all the same size.
Any other combination will "work," but not at optimum speed
 
Last edited:
  • Like
Reactions: HaykD
Are there chances that the same product on Amazon will have different part numbers for new purchases? I ordered the same product for the third slot.
 
Are there chances that the same product on Amazon will have different part numbers for new purchases? I ordered the same product for the third slot.
Yes, there is a chance, as manufacturers continually update their products.
If you have four DIMMs, the first pair does not need to have the same part number as the second pair, but they all need to be the same size (for optimum speed). If you have this situation, you need to install them in order AABB, rather than ABAB (where A and B are the two part numbers).
Hope this is not too confusing
 
  • Like
Reactions: HaykD
Thanks. I am going to install the third 32GB, remove 2 Apple RAMs, and see if I have 2600 MHz for 96GB RAM. Do I guess correctly that I can insert the third RAM in any slot currently occupied by Apple 4 GB RAMs?
 
Thanks. I am going to install the third 32GB, remove 2 Apple RAMs, and see if I have 2600 MHz for 96GB RAM. Do I guess correctly that I can insert the third RAM in any slot currently occupied by Apple 4 GB RAMs?
These are the requirements for optimum memory speed on the 2020 iMac:

1. DIMMs in slots 1 and 2 should have matching part numbers (or only one DIMM), else speed will drop to 2133 MT/s
2. DIMMs in slots 3 and 4 should have matching part numbers (or only one DIMM), else speed will drop to 2133 MT/s
3. DIMMs in slots 1 and 3 should be the same size, for full dual channel operation
4. DIMMs in slots 2 and 4 should be the same size, for full dual channel operation

If your speed drops to 2133 MT/s, you are not satisfying requirements 1 or 2. Switch DIMMs around so that you do satisfy them.
If you only have 3 DIMMs, it is impossible to satisfy both requirements 3 and 4.

What happens for you depends on whether the part number of your third DIMM matches the part numbers of your first and second DIMMs.

Hope this helps

btw, please report back if you find something different happens than I describe. These "requirements" are essentially deduced (i.e., reverse engineered) from many people's experiences on this forum when installing RAM in the 2020 iMac - we do not have special knowledge of how it is actually coded.
 
Last edited:
  • Like
Reactions: HaykD
These are the requirements for optimum memory speed on the 2020 iMac:

1. DIMMs in slots 1 and 2 should have matching part numbers (or only one DIMM), else speed will drop to 2133 MT/s
2. DIMMs in slots 3 and 4 should have matching part numbers (or only one DIMM), else speed will drop to 2133 MT/s
3. DIMMs in slots 1 and 3 should be the same size, for full dual channel operation
4. DIMMs in slots 2 and 4 should be the same size, for full dual channel operation

If your speed drops to 2133 MT/s, you are not satisfying requirements 1 or 2. Switch DIMMs around so that you do satisfy them.
If you only have 3 DIMMs, it is impossible to satisfy both requirements 3 and 4.

What happens for you depends on whether the part number of your third DIMM matches the part numbers of your first and second DIMMs.

Hope this helps

btw, please report back if you find something different happens than I describe. These "requirements" are essentially deduced (i.e., reverse engineered) from many people's experiences on this forum when installing RAM in the 2020 iMac - we do not have special knowledge of how it is actually coded.
Surely will do, thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.