Jump to content

M3 Macbook Pro Reviews. 8GB of RAM on a $1600 laptop is criticised heavily

filpo
6 minutes ago, leadeater said:

All unused memory*

 

If you would just look at the images and not immediately dismissed them you'd see that there is only "Cached files" and "Compressed". Mac OS land Compressed = Inactive. There is no inactive but not compressed.

Judging from what it reports in Activity Monitor, yes. You don't know how it works under the hood. Compressed could as well include inactive but not yet compressed/compressible. Again, simply compressing all parts of inactive memory with no regard for when they will be used again is probably not very optimal from a power/energy point of view, so I doubt that memory mgmt on macOS works like that, but there's no way for me to prove it.

In theory it could even differ between running on battery or not, but yeah, I don't think that's likely.

 

Cached files is yet another section of RAM that could be used more liberately on machines with more RAM to spare (but yes, that does not count as used memory in Activity Monitor).

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, leadeater said:

No, compressed is compressed, always.

Source?

Lets assume that's true: Then "inactive but not yet compressed/compressible" could be included in the active section - we don't know. So depening on memory pressure, more sections get moved to "Compressed", starting with the least probability of being used again "soon".

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Dracarris said:

Source?

Ok before I post the source link, literally Apple documentation, you are both advocating for and implying that Apple is willfully and actually lying or misusing specific computer terminology? Is this really the position you are taking?

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, leadeater said:

Ok before I post the source link, literally Apple documentation, you are both advocating for and implying that Apple is willfully and actually lying or misusing specific computer terminology? Is this really the position you are taking?

I'm saying that the terminology used in any kind of resource monitor is not 100% hard defined/clear. Now you may point me at Apples documentation, also with regard to my edited reply above.

 

Edit: Here's a direct quote from Apple's documentation:

Quote

Compressed: The amount of memory that has been compressed to make more RAM available.

When your computer approaches its maximum memory capacity, inactive apps in memory are compressed, making more memory available to active apps.

So you are right in regards to "compressed is always compressed", but so much for "inactive always gets compressed" - heck no, how much gets compressed is pressure-dependent and therefore RAM capacity-dependent, for a given workload/set of processes. FFS.

 

==> Systems with more RAM will compress less and report higher memory usage <==

 

And obviously, from above, what I said below must be true to some extent, aka, inactive/compressible sections must be included in the reported "active/apps" section.

36 minutes ago, Dracarris said:

Lets assume that's true: Then "inactive but not yet compressed/compressible" could be included in the active section - we don't know. So depending on memory pressure, more sections get moved to "Compressed", starting with the least probability of being used again "soon".

What exactly is defined as "inactive"? Not accessed since 1 nanosecond ago? There's a lot more nuance in this.

 

And obviously, there's compressed sections even with very little memory pressure as shown in your screenshot. So Apples documentation is an oversimplification - obviously - and when/how much compression takes place is based on much more complex decision making (where the fact that (de)compression uses power/energy is hopefully accounted for on mobile/battery powered machines).

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Dracarris said:

I'm saying that the terminology used in any kind of resource monitor is not 100% hard defined/clear. Now you may point me at Apples documentation, also with regard to my edited reply above:

 

Quote

Compressed: The amount of memory that has been compressed to make more RAM available.

 

When your computer approaches its maximum memory capacity, inactive apps in memory are compressed, making more memory available to active apps. Select the Compressed Memory column, then look in the VM Compressed column for each app to see the amount of memory being compressed for that app.

https://support.apple.com/en-nz/guide/activity-monitor/actmntr1004/mac

 

Apple is using this metric for a specific purpose and it's not anything other than actually compressed memory. It is actually important to be correctly reporting this and not just have it as maybe it is maybe it isn't, some but not all.

 

1 hour ago, Dracarris said:

What exactly is defined as "inactive"? Not accessed since 1 nanosecond ago? There's a lot more nuance in this.

Now that is a much better track to go down, at least it has some actual merit to it.  And yes "App memory" is a collective metric which contains both active memory and inactive. I think you need to go to terminal and use 'top' or other similar utility to get explicit active memory, that's how I would go get it anyway.

 

Practically speaking and going back to your example and assertion if we start up two Macs one with 8GB memory and the other with 16GB and open up Mail, Finder, Pages and Safari and did a little light usage both systems will be well off a high percentage of memory usage and both would be using the same heuristic, both are Mac OS, to determine what is active/inactive and when to compress it. It's only when memory utilization gets high will Mac OS preempt (as per their own documentation) the normal process and compress inactive memory it wouldn't have otherwise yet.  Despite your desire to keep insisting it is more complicated than it is, it's actually not. As long as we are confining this to Mac OS things are actually quite consistent even with vast differences in installed system memory. Mac OS simply and often takes inactive memory and compresses it because it's actually inexpensive and very quick on Apple silicon Macs, it was designed to be so. Target compression ratio is also the factor on how computationally demanding it is which would not be a high target in this use case.

 

This is exactly why I brought up Active Memory because that is the real factor in if 8GB is sufficient or not, as well as Cached. Operating systems simply do need Cached memory to maintain good operating and responsiveness and this is often pointed to when systems get tight on memory and people want "ram freeing programs" to release this cache because they think it'll help but it actually makes it worse. Anyway the more Apps you open and the more you do with them the higher the active memory will be along with Wired (which cannot be swapped or compressed) which is why I'm saying it's not the difficult to actually need, or be more correctly serviced with greater than 8GB system memory. And context here does play in to it, this is a $1600 laptop under the MacBook Pro product line. The nice little irk on both sides of the preference towards or away from the "Apple line" is the rhetoric around Macs being used for actual work and also "professional" devices. If we are going to embrace that yes MacBook Pros are devices for real work and professionals then it's not a stretch to assert that usage demands for greater than 8GB is not uncommon and being able to get by with 8GB is not acceptable for both a $1600 laptop and a professional device. You can ask any Mac user their experience of using an application like Microsoft Teams and you'll know right away that this application alone is a terrible memory hog and also sub optimal performance in general and corporate usage of Microsoft 365 and Teams is common. So even a regular Linux Systems Engineer or Administrator with a MacBook Pro who for the most part ssh in to Linux systems can easily get in to a situation of greatly benefiting from more than 8GB system memory even if only using terminal/xterminal, Teams, Outlook/Mail, Pages/Word, Safari/Chrome for Confluence+ITSM tool+Internal managment interfaces+vCenter etc without even getting in to more demanding use cases like local containers/VMs.

 

It's all well and good to just say if you know you need more then spec it with more and pay for it but my issue with that is the simple act of offering an 8GB option has a real cost to it and setting the minimum at 16GB would actually have a cost saving in multiple operating logistics and manufacturing aspects while only having a small increase in cost for DRAM. This I contend could either be absorbed in to the current price without any notable net margin difference for Apple or they could just slightly increase the base price of an amount less than the 16GB upgrade.

 

My issue is not that Mac OS with 8GB is or is not perfectly sufficient for many people it's on what specific devices this is offered on. There is an actual difference between a MacBook Air, MacBook and MacBook Pro. They do not all need to have 8GB options and they all have or could have more than one screen/chassis size option. I don't have an issue at all for example with the MacBook Air 13" M2 with 8GB memory for $1099.

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, leadeater said:

Mac OS simply and often takes inactive memory and compresses it because it's actually inexpensive and very quick on Apple silicon Macs, it was designed to be so. Target compression ratio is also the factor on how computationally demanding it is which would not be a high target in this use case.

This is directly contradicted by their documentation, which you just used to support your point:

1 hour ago, Dracarris said:

When your computer approaches its maximum memory capacity, inactive apps in memory are compressed, making more memory available to active apps.

As I already said, this obiously isn't the full story as compression happens well before that. So we can conclude that Apples documentation is heavily simplified - obviously. It also does not explicitly state that no compression at all happens when the computer hasn't approached max memory capacity.

14 minutes ago, leadeater said:

Despite your desire to keep insisting it is more complicated than it is, it's actually not.

Did you write the memory mgmt for macOS? Do you know the heuristics and criteria that under the hood decide when to compress what? You're an experienced system admin, that does however not mean you know the inner workings of every OS out there.

14 minutes ago, leadeater said:

Practically speaking and going back to your example and assertion if we start up two Macs one with 8GB memory and the other with 16GB and open up Mail, Finder, Pages and Safari and did a little light usage both systems will be well off a high percentage of memory usage

That's not the interesting case, which happens when usage approaches 8GB (lets say around 6-7GB of app+wired sections) but stays below 8GB. That's when the same heuristics will take different decisions what to compress and what not as memory pressure will be vastly different on an 8 and 16GB machine, as directly stated in their documentation (memory pressure having an influence onto compressing inactive apps).

Link to comment
Share on other sites

Link to post
Share on other sites

This something I have always said and will still be saying: The real stink in Apple is in the low-end. The high-end you can justify with special usecases and whatever and they are absolutely great machines, the low-end is just garbage sold as gold for fools. At the point where you can get by with the lowest specced Mac, unless you have some very specific thing where you absolutely need Mac, you can get by with just very basic laptop for less than half the price or bit over half the price and get some extra features.

 

With 8GB of shared memory, yeah, you can browse the net and do some office work, but you don't really need over 2000€ (2069€ in Finland) laptop to do that. Basicly everything else in that machine is just bloating the price at that point and you could get more for less. With the money you save from Apple logo, you can totally brutalize the little aspects low-end Mac gives over the basic PC with accessories, you can get good ergonomic monitor, keyboard and mouse for the office work, probably even the motorized table and good chair for the over 1000€ you would otherwise use for things that don't really matter (for office work you don't need "cinema" screen, battery capacity isn't also that big thing, the 6 speakers are completely wasted, the 1080p webcam you can get for 40€, we can argue about small size, Apples "security" is basicly level of going to Swiss bank to store the keys for your 400€ 10th hand 40 years old completely beaten Toyota, the more powerful processor... People at that point hardly know what is a processor and they want snappy machine which can be done just by not buying a complete garbage like Acer).

 

I will underline that there are cases where the over 2000€ MBP with 8GB of shared RAM and 512GB SSD could be the best (or more likely the only) option but those are very rare, like we are talking about people who either really, really, really need something Apple exclusive or you want a fashion statement.

Link to comment
Share on other sites

Link to post
Share on other sites

24 minutes ago, Dracarris said:

This is directly contradicted by their documentation, which you just used to support your point:

And yet this is actually what Mac OS does and you are very welcome to utterly ignore all the systems with compressed memory and utilization below 50%.

 

24 minutes ago, Dracarris said:

Did you write the memory mgmt for macOS? Do you know the heuristics and criteria that under the hood decide when to compress what? You're an experienced system admin, that does however not mean you know the inner workings of every OS out there

Does anyone need to to be able to understand how it works? lol

 

24 minutes ago, Dracarris said:

That's not the interesting case,

It's what you damn well wanted and brought up 🤷‍♂️

 

Pick something else then. It's not going to change anything until you are presenting a case where 8GB actually is insufficient otherwise memory usage are going to be similar to the point of irrelevance. You're going to always hit the issue known as "too clean", this happen in science when you isolate or eliminate so many variable it no longer has relevance or represents real world and becomes non-useful. If you want to keep it perfectly clean and comparable between two systems then you have to use them identically and for the same amount of time in the same exact ways and you will only see higher memory utilization on the Mac with more memory when you encroach on the upper utilization of the lower memory Mac, but all you have done then is shown a use case where you need more than 8GB so what was the point? 

 

Operating systems don't just chew up memory for no reason, if a file is in memory cache then you must have accessed it, if an application has active/inactive/compressed memory then it is a running process. So there are only a few situations where your original statement in general would be true 1) When you actually need that increase memory due to real increased/demanding usage 2) You have recently walked a large filesystem structure and read a lot of files leaving them cached. Mac OS simply doesn't leave around inactive memory and not compress it, that's actually not what it does in reality. Sure Apples documentation very simply mentioning that it gets done under memory pressure yet inactive memory is taken and compressed always, you will not find a Mac OS system with no compressed memory that isn't a literal just booted up.

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Thaldor said:

This something I have always said and will still be saying: The real stink in Apple is in the low-end. The high-end you can justify with special usecases and whatever and they are absolutely great machines, the low-end is just garbage sold as gold for fools. At the point where you can get by with the lowest specced Mac, unless you have some very specific thing where you absolutely need Mac, you can get by with just very basic laptop for less than half the price or bit over half the price and get some extra features.

 

With 8GB of shared memory, yeah, you can browse the net and do some office work, but you don't really need over 2000€ (2069€ in Finland) laptop to do that. Basicly everything else in that machine is just bloating the price at that point and you could get more for less.

Ignoring literally every hands-on report here and elsewhere from owners of 8GB machines and what they do with it. Nice job.

Hint: That's not only browsing and office work. Hint2: Pro work is not equal to high-perf work, and at the same time "Pros" will appreciate/profit from/require features and properties of laptops that are not found in cheaper machines that have nothing to do with raw performance and even less with spec numbers. Maybe you could point them to a cheaper machine with 20+ h of battery lifetime.

 

17 minutes ago, Thaldor said:

With the money you save from Apple logo, you can totally brutalize the little aspects low-end Mac gives over the basic PC with accessories, you can get good ergonomic monitor, keyboard and mouse for the office work, probably even the motorized table and good chair for the over 1000€ you would otherwise use for things that don't really matter (for office work you don't need "cinema" screen, battery capacity isn't also that big thing, the 6 speakers are completely wasted, the 1080p webcam you can get for 40€, we can argue about small size, Apples "security" is basicly level of going to Swiss bank to store the keys for your 400€ 10th hand 40 years old completely beaten Toyota, the more powerful processor... People at that point hardly know what is a processor and they want snappy machine which can be done just by not buying a complete garbage like Acer).

So, a Macbook which can be carried anywhere and away from a power source now all the sudden becomes a Desktop PC if it favors in your price comparison? Interesting take indeed!

You obviously have never used a Macbook and don't know what differentiates them from laptops that are a bit above garbage-Acer, and why "Professionals" keep using and paying for them. Just because a machine can run a browser fluently does in no way mean that it can provide a good overall experience and provide the same productivity boost than a much more expensive machine, whether this being a Macbook or an expensive machine from Windows land with comparable properties (Higher-end Lenovo, Dell XPS for example).

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, leadeater said:

Does anyone need to to be able to understand how it works? lol

In order to make such bold statements like you do ("duh it's totally simple"): Yes. (lol)

12 minutes ago, leadeater said:

Pick something else then. It's not going to change anything until you are presenting a case where 8GB actually is insufficient otherwise memory usage are going to be similar to the point of irrelevance.

I already did in my last reply. When approaching 8GB of total usage, a machine with 8GB of total RAM will behave/manage/compress differently than one with 16GB. For starters the 8GB machine will compress more aggressively to avoid swapping while the 16GB machine can relax quite a bit more and use more than 8GB, even though it could stay under (that now irrelevant line) by compressing some inactive sections. How is that so hard to understand?

 

Ignoring the fact that the latter one will more liberately cache files in memory, even though that's not reported as "used memory".

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, leadeater said:

It still has absolutely no relation at all to active memory since that won't change with system up time as only the active processes at the point in time influence how much of that there is.

Bold of you to assume most running stuff has no memory leaks /s

(too bad you're running servery stuff on those, I wonder if leaving chrome/discord/other electron crap running for long enough would make it go past 20gb use)

3 hours ago, leadeater said:

The main difference between Windows and Unix based systems is Windows will preference swapping out memory for running applications that isn't active while Unix will leave it in memory unless it actually needs swap space, like my images showed. There is no reason for Windows to have any swap usage with 384GB memory and only 18GB used but it swapped out 467MB anyway. The Linux system on the other hand has zero usage of swap because using any at all is completely unnecessary so why do it, this is a trait of Unix systems I like much better than Windows.

That's defined by the vm.swappiness parameter, I believe each distro sets it to their own, you can totally make it behave like windows without issues If you're bold enough, you can tell it that disk is as fast as RAM lol

3 hours ago, leadeater said:

P.S. One of the reasons Mac OS does so well with so little memory is the memory compression is extremely good

We have zram on linux too! ChromeOS makes tons of use of it in order to make those 4gb devices really useful for basic tasks in a browser, it's pretty good tbh.

2 hours ago, Dracarris said:

Since "used" memory is reported as active+inactive, both systems will show different memory utilizations with the same workload.

MacOS and Linux don't, the cached part is not counted on the total. Windows for some reason seem to do so, or I may have forgotten how it looks and I'm too lazy to look for leadeater's screenshots here lol

As an example:

image.png.aa18ec92237c968157558a34e395b5b7.png

The cached part is not accounted for in the "used" part.

 

On my linux desktop with a week or so of uptime:

image.png.4ebfd7d49fe105bc4dcf735665741ebd.png

image.png.cdae0d34bf1c679c839c5afb04a1b0c4.png

 

As you can see, the only used part is really low (<20gb), however there's not much free since most of the remaining ram is used as cache (but it's still not taken into account for the used part).

 

1 hour ago, Dracarris said:

That makes little to no sense as compressing and decompressing requires CPU time and energy aka battery life, so compressing stuff that will realistically be used again soon is not very clever.

Compression nowadays is actually almost free, and orders of magnitude cheaper than having to access the disk, so it may be worth it. Ofc if the app is often used it won't/shouldn't be compressed at all to begin with, but as said by others it only compressed unused stuff.

1 hour ago, Dracarris said:

You don't know how it works under the hood. Compressed could as well include inactive but not yet compressed/compressible. Again, simply compressing all parts of inactive memory with no regard for when they will be used again is probably not very optimal from a power/energy point of view, so I doubt that memory mgmt on macOS works like that, but there's no way for me to prove it.

If only we had the source for it...

Oh, wait, we do!

https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/vm/vm_compressor.c

 

It's a fancy LRU (like most memory algorithms), and compressed memory is actually compressed, it has to be tagged as so by the compressor.

Fun fact, Mac seems to use LZ4 (widely known) and their own WK algorithm for compression, I couldn't find much about it tho, neither does the internet:

https://cs.stackexchange.com/questions/126105/source-code-or-detailed-explanation-of-wks-virtual-memory-compression-algorith

36 minutes ago, Dracarris said:

Do you know the heuristics and criteria that under the hood decide when to compress what? You're an experienced system admin, that does however not mean you know the inner workings of every OS out there.

That's freely available haha

10 minutes ago, Dracarris said:

You obviously have never used a Macbook and don't know what differentiates them from laptops that are a bit above garbage-Acer, and why "Professionals" keep using and paying for them. Just because a machine can run a browser fluently does in no way mean that it can provide a good overall experience and provide the same productivity boost than a much more expensive machine, whether this being a Macbook or an expensive machine from Windows land with comparable properties (Higher-end Lenovo, Dell XPS for example).

I have and I hate my work's MBP 😛

The M2 model is actually full of bugs (other coworkers faced similar bugs, wheres coworkers with their M1s did not), the system is a bit shitty and I hate MacOS window management. The laptop seems to be more heavy than needed, but most other "pro" laptops also weight similarly, so I digress.

Battery life is really good (7h of video calls, 8~14 hours of lightweight work), performance is ok (far from desktop levels, but better than other Intel laptops I had experience with - haven't used any Ryzen laptop tbf) and the build quality is solid. But oh boy, does the OS sucks.

I don't feel any  more productive with it when compared to any other linux device I use (it actually hinders me), but it is needed due to compliance reasons and my only other option would be using windows, which is way worse IMO.

 

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

32 minutes ago, Dracarris said:

I already did in my last reply. When approaching 8GB of total usage, a machine with 8GB of total RAM will behave/manage/compress differently than one with 16GB. For starters the 8GB machine will compress more aggressively to avoid swapping while the 16GB machine can relax quite a bit more and use more than 8GB, even though it could stay under by compressing some inactive sections.

 

Ignoring the fact that the latter one will more liberately cache files in memory, even though that's not reported as "used memory".

Yes but I have actually already address that use case and situation and told you it's not at all valid to your original statement and what you were implying or how it came across.

 

Here is my first reply again just to align the starting point since I think at this point that appears to matter

18 hours ago, leadeater said:

the give OS more ram and it'll use more lacks far too much additional analysis and actually does not address the issue of if 8GB is enough or not and putting lots of pressure on swap is never a good thing no matter if it does or does not impact performance or system responsiveness. 

 

 

See it's my opinion you only brought this up, "systems with more use more", as a contextual and relational comment as to whether or not 8GB is suitable or generally sufficient and you are trying to point out that systems with more system memory will report higher total usage in GB compared to a lesser equipped system memory device as a means to show or imply that the larger memory amount isn't necessarily required. Is this fairly close to your intention and what you were saying?

 

Now that would indeed be correct when the lesser system memory device is under memory pressure but that is precisely why I brought up the point about lack of analysis since if that is the situation then my counter is the lesser equipped system may have insufficient memory and is being forced to swap memory out and preemptively compress memory. The degree to how much it is having to do this realistically determines if it is a problem or not and if the system does not have enough system memory, which is why I am bringing up active memory. Because no matter how much more extra system memory you put in a device it will not use any more active memory and active memory is the metric you look at to determine how much system memory you probably should have. Having 7GB of active memory and relying on swap is not a good idea, the system/device will be functional and usable but I'm simply not going to say this is an ideal or acceptable situation to be in. So for me it's not at all relevant that a system with 16GB system memory would be reporting more usage than the 8GB system in this usage scenario I am presenting because the fact that the 16GB is using more is not a simple case of it is only doing so because it's "caching more stuff", the 8GB system is actually suffering.

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, igormp said:

If only we had the source for it...

Oh, wait, we do!

https://github.com/apple-oss-distributions/xnu/blob/1031c584a5e37aff177559b9f69dbd3c8c3fd30a/osfmk/vm/vm_compressor.c

 

It's a fancy LRU (like most memory algorithms), and compressed memory is actually compressed, it has to be tagged as so by the compressor.

Fun fact, Mac seems to use LZ4 (widely known) and their own WK algorithm for compression, I couldn't find much about it tho, neither does the internet:

https://cs.stackexchange.com/questions/126105/source-code-or-detailed-explanation-of-wks-virtual-memory-compression-algorith

Thanks for the interesting insight - did not know that part of macOS uses OSS code!

 

So "fancy least-recently-used" is basically what I was eluding to in my previous replies where we debated about how macOS decides when and what to compress. And I would also argue that this is not a terribly simply algorithm/decision making.

 

Btw from the repo you linked:

Quote

XNU kernel is part of the Darwin operating system for use in macOS and iOS operating systems. XNU is an acronym for X is Not Unix. XNU is a hybrid kernel combining the Mach kernel developed at Carnegie Mellon University with components from FreeBSD and a C++ API for writing drivers called IOKit. XNU runs on x86_64 for both single processor and multi-processor configurations.

Do they use sth different for the ARM based Macs?

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, igormp said:

That's defined by the vm.swappiness parameter, I believe each distro sets it to their own, you can totally make it behave like windows without issues If you're bold enough, you can tell it that disk is as fast as RAM lol

Windows is a tiny bit different, even if you push up the swappiness value. Not sure if different good or different bad heh

 

Quote

Windows will try to mirror every page from RAM onto the paging file if it can. This will allow it to quickly drop pages out of RAM when it needs to reuse them for something else. This is why Windows will try to create a paging file at least as big as the physical RAM you have installed on your machine.

Linux/Unix doesn't do that so the underlying process to swap in is a little different and I think more costly. On the other hand I vehemently hate that Windows tries to create a pagefile the size of memory by default.

Edited by leadeater
Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Dracarris said:

And I would also argue that this is not a terribly simply algorithm/decision making.

Not terribly simple, but far from terribly har, otherwise you'd waste way too much CPU time on memory management.

They have docs on that (quite old, but if you look at the code history it hasn't changed much over the years), and it seems to be LRU + some basic per-app heuristics to see some access patterns:

https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html#:~:text=the free list.-,Paging Out Process,-In OS X

 

3 minutes ago, leadeater said:

Windows is a tiny bit different, even if you push up the swappiness value. Not sure if different good or different bad heh

 

Linux/Unix doesn't do that to the underlying process to swap in is a little different and I think more costly. On the other hand I vehemently hate that Windows tried to create a pagefile the size of memory by default.

This seems to generate tons of needless IO lol

Yeah, not a fan of Windows memory management, but I'm not a fan of many Windows-things, so I'm for sure biased against it haha

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

30 minutes ago, Dracarris said:

Ignoring literally every hands-on report here and elsewhere from owners of 8GB machines and what they do with it. Nice job.

Hint: That's not only browsing and office work. Hint2: Pro work is not equal to high-perf work, and at the same time "Pros" will appreciate/profit from/require features and properties of laptops that are not found in cheaper machines that have nothing to do with raw performance and even less with spec numbers. Maybe you could point them to a cheaper machine with 20+ h of battery lifetime.

 

So, a Macbook which can be carried anywhere and away from a power source now all the sudden becomes a Desktop PC if it favors in your price comparison? Interesting take indeed!

You obviously have never used a Macbook and don't know what differentiates them from laptops that are a bit above garbage-Acer, and why "Professionals" keep using and paying for them. Just because a machine can run a browser fluently does in no way mean that it can provide a good overall experience and provide the same productivity boost than a much more expensive machine, whether this being a Macbook or an expensive machine from Windows land with comparable properties (Higher-end Lenovo, Dell XPS for example).

Give me ONE usecase where 2069€ M3-14" Macbook Pro Fur Hat edition does justify the 700€ price difference from M2-13" Macbook Air at 1349€ and it would be complete overkill to invest the 230€ more for double the shared memory. I will accept also the more balanced version with just 500€ price difference if we configure the MBA with the same 512GB SSD.

 

I will predict you will reply with something that requires more physical ports to which I would reply a dongle is still 10-times cheaper than the MBP, that is one huge price premium.

And do notice that in the part that you cut off because your rage about that someone doesn't agree with the stupidity of low-end Macs, that I did specify that in common browser/office work the price difference would be better used for ergonomics of the workplace than to get the MBP.

 

And yes, I do use Mac, though as a tablet replacement and it's "just" early-2014 MBA fur hat (i5, 4GB, 126GB) that I got for fixing it, I haven't even upgraded it to the "best" MacOS it could run jsut because I believe I get more out of 32-bit software support than some extra glitter. It's hardly a computer by modern standards but for my use, I don't need 2000€ machine to run browser.

Link to comment
Share on other sites

Link to post
Share on other sites

29 minutes ago, Thaldor said:

Give me ONE usecase where 2069€ M3-14" Macbook Pro Fur Hat edition does justify the 700€ price difference from M2-13" Macbook Air at 1349€ and it would be complete overkill to invest the 230€ more for double the shared memory. I will accept also the more balanced version with just 500€ price difference if we configure the MBA with the same 512GB SSD.

Going with an Air makes sense in many cases, especially since the perf compromise is rather small for the price gap, at least that's how it used to be.

One use case would be where the display of the Pro models matter or sustained workloads that are CPU/GPU intensive without requiring a ton of memory, or where the extra hours away from the wall of the Pro models matter.

 

A dongle is not always a very practical solution, especially when frequently on the go.

 

29 minutes ago, Thaldor said:

It's hardly a computer by modern standards but for my use, I don't need 2000€ machine to run browser.

That's okay for you, but as I have explained before: Simply because a machine can run a browser, does not mean the overall user experience with it will be as good as a 2000Euro machine running the same browser.

Especially these days, where so many tasks/apps are basically a resource-hungry browser, including desktop clients for messaging systems - these perf-related aspects just on top of all the non-perf related aspects that differentiate the 2k machine. It's unbelievable to me how people here fail so horribly to see properties of computers past raw CPU/GPU horsepower, RAM and storage capacity - especially on laptops.

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, leadeater said:

Windows is a tiny bit different, even if you push up the swappiness value. Not sure if different good or different bad heh

 

Linux/Unix doesn't do that so the underlying process to swap in is a little different and I think more costly. On the other hand I vehemently hate that Windows tries to create a pagefile the size of memory by default.

11 minutes ago, igormp said:

Not terribly simple, but far from terribly har, otherwise you'd waste way too much CPU time on memory management.

They have docs on that (quite old, but if you look at the code history it hasn't changed much over the years), and it seems to be LRU + some basic per-app heuristics to see some access patterns:

https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/AboutMemory.html#:~:text=the free list.-,Paging Out Process,-In OS X

 

This seems to generate tons of needless IO lol

Yeah, not a fan of Windows memory management, but I'm not a fan of many Windows-things, so I'm for sure biased against it haha

 

The vm.swappiness value on Linux and MacOS/BSD by default acts differently.

 

Out of the box BSD's don't use the swap partition at all until active memory approaches the maximum. Linux and Windows use the swap space immediately to page out inactive processes unless you've changed the settings.

 

on Web servers I manage, I usually toggle the vm.swappiness value to the same as BSD so it doesn't start paging out, because on a web server, if it starts touching the the page file, some process has run amok, and will make linux servers impossible to rescue remotely, because the OS will have paged out sshd. Where as on FreeBSD, it will actually kill the process that is doing that, but sometimes it ALSO will kill the wrong process, and render the OS inoperable.

 

Windows behaves the same way, where if it runs out of RAM and the swap is disabled, it simply won't let you run anything new, and anything still allocating RAM will just crash. If swap is enabled, the OS will start swap thrashing heavily until it has allocated all the assigned swap space, and then whatever has run away will crash. Windows however will not let you turn the page file off and then "work like nothing has changed", as it also uses the page file to do a memory dump, but if you have it set to the recommended size (1.5x system RAM since win9x) you're just needlessly wasting disk space. 

 

All other OS's (MacOS, BSD, Linux, etc) have a swap partition at the "fastest part of the hard drive" which made sense when drives were mechanical, but on a SSD there is no longer such a thing, however they are still partitions, not files. Windows infamously will create more swap space by allocating more disk space, even if it fragments the page file, which makes things worse on a mechanical drive, but again, SSD doesn't matter. Still, having a fixed partition means that space can never be reclaimed for storage, and it's wasted if it's not used for something.

 

Hence the key difference between Windows and every other OS, Windows can dynamically change the size of the swap file, to it's own detriment, where as Linux, BSD, MacOS can either compress and page out processes, or it can just let the swap partition do nothing if the swapiness value is set to do so. On Linux, the default is like 60, so if 60% of the system memory is used, THEN it decides start paging out. The typical suggestion is to set vm.swappiness to 1 if you have enough system memory. BSD, again basically behaves like it's set to 1 out of the box.

 

On MacOS this is nvram boot-args="vm_compressor=?" , where this value is set to 4 by default, but various online sources say to set to 2, to give the effect of "vm.swappiness=1"

https://opensource.apple.com/source/xnu/xnu-6153.61.1/osfmk/vm/vm_compressor.c.auto.html

from the matching header, these values are associated with this:

Quote
#define C_IS_EMPTY              0
#define C_IS_FREE               1
#define C_IS_FILLING            2
#define C_ON_AGE_Q              3
#define C_ON_SWAPOUT_Q          4
#define C_ON_SWAPPEDOUT_Q       5
#define C_ON_SWAPPEDOUTSPARSE_Q 6
#define C_ON_SWAPPEDIN_Q        7
#define C_ON_MAJORCOMPACT_Q     8
#define C_ON_BAD_Q              9
#define C_ON_SWAPIO_Q          10

This is however not a fair comparison.

In linux:

https://github.com/torvalds/linux/blob/master/mm/vmscan.c

Quote


/*
 * From 0 .. 200.  Higher means more swappy.
 */
int vm_swappiness = 60;
 

https://github.com/torvalds/linux/blob/master/include/linux/swap.h

 

That's it. see docs

https://github.com/torvalds/linux/blob/master/Documentation/mm/multigen_lru.rst

https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/mm/multigen_lru.rst

 

Describes how it works on Linux.

 

Overall, what people experience on all OS's is the same however. As soon as the computer starts substituting RAM with swap, the performance tanks substantially. SSD's make this a lot less obvious since on mechanical disks you'd often hear the drive chatter frequently the more it started swap thrashing. With an SSD, now people just observe that the performance will jump between being responsive and being unresponsive, as before, but now without the hard drive noise cue. It can be completely deceiving that you are eating the SSD by running more applications, and just taking a performance penalty. If a SSD's bandwidth is around 8GB/sec, and the system memory is around 38GB/sec, then that penalty under optimal conditions is about 4.5x slowdown, plus the access time latency.

 

What would require a fair comparison is to setup a Windows, MacOS and a Linux system on similar spec'd hardware run a memory pressure benchmark where it just keeps forking processes until it hits the OOM killer, and then see how quickly it recovers. Then repeat with the swap space completely turned off (eg swapiness 0, swap partition unavailable/swap file deleted) and compare the responsiveness before it hits the OOM killer.

 

But from experience, the out-of-the-box swapiness=1 on BSD has generally been the preferable setting for servers since you would not configure your server to ever hit the page file to begin with. A desktop or laptop is not operated in that manner, thus you would want more RAM even if you maybe don't necessarily NEED that much RAM, because applications have unpredictable memory usage (or even leak.) Many programs have "undo edit" systems that will just continually allocate memory until the document is closed. Then you have CEF-based apps that just behave like a continuously infinite-scrolling web page (eg twitter, facebook) and just leak memory constantly the longer they remain open. Especially when ads constantly reload themselves like in the spotify example.

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, leadeater said:

Windows tries to create a pagefile the size of memory by default

It's been a few years now since I've had to do anything on Windows, but seeing the word `pagefile` mentioned just brought back horrible memories of dealing with that stuff on already poorly performing local VMs.

 

Thanks for that 😄

Link to comment
Share on other sites

Link to post
Share on other sites

As we're sharing memory usage graphs and discussing whether macOS will always compress memory not currently in use.... This is with an Apple Silicon VM running that has 16gb assigned to it, Safari with two windows and I've lost count of how many tabs in each, Teams, Chrome, and a few other random apps...

image.thumb.png.7c9ceafe621f8fb84d0e923eb8e377a9.png

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Kisai said:

Linux and Windows use the swap space immediately to page out inactive processes unless you've changed the settings.

On linux the default depends on the distro, there's no universal value. IIRC, if you build a kernel from scratch it defaults to 60, which moves thing to swap as you get somewhat above half ram total use.

On my devices I also set it closer to 0, so it should be similar to what you mentioned.

2 hours ago, Kisai said:

Where as on FreeBSD, it will actually kill the process that is doing that, but sometimes it ALSO will kill the wrong process, and render the OS inoperable.

You can also change the OOM-killer threshold on linux to kill stuff instead of being way too lenient.

2 hours ago, Kisai said:

All other OS's (MacOS, BSD, Linux, etc) have a swap partition at the "fastest part of the hard drive" which made sense when drives were mechanical, but on a SSD there is no longer such a thing, however they are still partitions, not files.

Linux can have both a partition or file. I have both in my desktop 😛

2 hours ago, Kisai said:

Hence the key difference between Windows and every other OS, Windows can dynamically change the size of the swap file, to it's own detriment, where as Linux, BSD, MacOS can either compress and page out processes, or it can just let the swap partition do nothing if the swapiness value is set to do so. On Linux, the default is like 60, so if 60% of the system memory is used, THEN it decides start paging out. The typical suggestion is to set vm.swappiness to 1 if you have enough system memory. BSD, again basically behaves like it's set to 1 out of the box.

Windows also does compression IIRC.

Also, the swappiness is a weight on the relative performance of the disk and ram. 100 means that both are equally fast, 199 says that the disk is way faster than ram, 1 says that the ram is way faster than the disk. This is useful when you have stuff like zram and swap, so you want stuff to get there as fast as you can.

You can see the docs for it here:

https://docs.kernel.org/admin-guide/sysctl/vm.html

(I see that you linked the code for adjacent stuff, but still).

 

2 hours ago, Kisai said:

Overall, what people experience on all OS's is the same however. As soon as the computer starts substituting RAM with swap, the performance tanks substantially.

Agreed.

 

2 hours ago, Kisai said:

Then repeat with the swap space completely turned off (eg swapiness 0, swap partition unavailable/swap file deleted) and compare the responsiveness before it hits the OOM killer.

Oh, I've done that by accident lol

With systemd's OOMK, it's pretty much instant. Took me a while to notice why stuff was being killed until I looked at dmesg and noticed I had swap off for some reason.

 

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Paul Thexton said:

As we're sharing memory usage graphs and discussing whether macOS will always compress memory not currently in use.... This is with an Apple Silicon VM running that has 16gb assigned to it, Safari with two windows and I've lost count of how many tabs in each, Teams, Chrome, and a few other random apps...

image.thumb.png.7c9ceafe621f8fb84d0e923eb8e377a9.png

Wow. That's interesting - I've never had 0 bytes of Compressed and probably also Swap never showed actual zero (on a machine with 16GB and "intense" regular usage). Maybe the reason is that I only reboot that machine every few weeks so at some point there probably was not enough RAM available and then it sticks? Have to check next time I'll reboot.

 

I wonder what the experts here have to say about those stats of yours 🙂

2 hours ago, Monkey Dust said:

The big problem with 8GB of RAM is the use of the SSD for swap. The swap eats into the SSD lifetime writes, and when they are up, the SSD isn't replaceable... 

Yeah. I'm still waiting for the first wave of mass-failing Macbooks due to extreme swap activity. Then there should be a clear correlation between RAM/SSD capacity and failure rate (large SSD with small RAM being less problematic than small SSD with small RAM).

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Dracarris said:

Yeah. I'm still waiting for the first wave of mass-failing Macbooks due to extreme swap activity. Then there should be a clear correlation between RAM/SSD capacity and failure rate (large SSD with small RAM being less problematic than small SSD with small RAM).

I'd say that it's likely to happen with 5~7 years, which should happen given how long people keep their mac devices.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×