Apple says memory leak in Finder is not a leak, but a design feature

Joined
Jan 1, 2009
Messages
15,512
Reaction score
3,876
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)

Rod


Joined
Jun 12, 2011
Messages
9,704
Reaction score
1,892
Points
113
Location
Melbourne, Australia and Ubud, Bali, Indonesia
Your Mac's Specs
2021 M1 MacBook Pro 14" macOS 14.4.1, Mid 2010MacBook 13" iPhone 13 Pro max, iPad 6, Apple Watch SE.
I don't use Gallery or Icon view much, hardly at all but I do have 16GB RAM and the "leak" appears to be temporary but it is definitely worth knowing. Just as well other apps don't do the same thing. The author may be right in suggesting that this be a user choice thing?
 
Joined
Feb 1, 2011
Messages
4,435
Reaction score
2,153
Points
113
Location
Sacramento, California

Thank you; this is exactly as I previously explained.

The Mac OS doesn't have a leak, and it's not a "memory hog" either. It has extremely smart memory management, and when it sees RAM sitting unused, it caches things to improve performance.

I believe that Hoakley, and others, are just looking for things to be unhappy about. The whole memory leak thing is a complaint (actually somewhat of a conspiracy theory) in search of users who are actually having a problem. None exist.
 
OP
MacInWin
Joined
Jan 1, 2009
Messages
15,512
Reaction score
3,876
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
I don't use Gallery or Icon view much, hardly at all but I do have 16GB RAM and the "leak" appears to be temporary but it is definitely worth knowing. Just as well other apps don't do the same thing. The author may be right in suggesting that this be a user choice thing?
No, there is no user choice in how it works. And the whole response from the Apple folks is just strange and not backed up by objective reality. For example, do you know of any computer process that happens in "2 or 3 days?" If there is a timer on how long these cached thumbnails are kept, does it have a randomizer attached to vary the time? How can a digital processor decide "2 or 3 days?" The whole answer from Apple smells of a "go away and stop bothering me" kind of answer. Howard did test it, as he wrote, and it did release the memory after just over 48 hours (closer to 50 hours, but hey, by Apple's computation, that's close enough).

In my own testing, some parts of Apple's explanation don't seem to hold up. I noticed in my own testing that the upsurge in memory reported by Activity Monitor as being used by Finder was there (I got it to be over 2GB by using multiple folders to increase the number of images it had cached), and it stayed around for a long time, but that at the same time, Activity Monitor reported a DECREASE in Memory Used and a DECREASE in Cached Files space. Then, when I killed Finder to recover the space, there was ZERO change in Memory Used and Cached Files, even though Finder had released almost 2 GB of memory, supposedly. Also, the used storage space on the SSD portion of the fabric storage was unchanged, meaniing these images were not, appparently, stored on the SSD. So, where are these alleged cached images being stored? Is there a more fundamental issue with Activity Monitor/Memory usage/Finder that Apple doesn't want to talk about? If it were a couple of hundred MB, that's one thing, but to lose track of over 2GB of storage is concerning.

There will be those folks who deny that anything is wrong, that Apple is perfect and too smart for us poor dumb users to understand. They will use this report from Apple as justification to do victory laps waving the "Apple is perfect" flag. But there are still a lot of questions about this whole issue that need investigation/exploration, and Apple's casual approach isn't helping.
 

IWT


Joined
Jan 23, 2009
Messages
10,292
Reaction score
2,231
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sonoma 14.4.1 Apple 5K Retina Studio Monitor
This is not an insult, Jake, I promise; but may I ask a question?:);)

In what way would all this impinge on the average Mac user?

I feel the question is relevant in that I suspect that very few users are likely to check Activity Monitor or, indeed, feel that they needed to; and would they recognise a background memory leak in the first place?

Ian
 
OP
MacInWin
Joined
Jan 1, 2009
Messages
15,512
Reaction score
3,876
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
In what way would all this impinge on the average Mac user?
Unknown. And that is the biggest issue. The average user may not notice this creeping usage of wherever that cache may be until the system is overloaded and crashes, or intrudes into other things. Of course, the excusers will say that it goes away in 2/3 days, no problem, but if you use the icon view as your default, it must be refreshing that 2/3 day "clock" every time you use Finder. And with every new folder you open, Finder's cache grows. But without knowing WHERE this cache is, and with no way to check it periodically, the average user is blinded to the issue, until that crash happens. What is the limit? Nobody knows. Apple's answer is vague enough to cover a multitude of issues.

I don't like the design. It's stupid. I understand the principle of the cache, but with the memory speeds and the retrieval speeds from internal storage on the new Apple Silicon, the whole argument that somehow this cache speeds up Finder is very thin. And in a good design Finder should release that cache as soon as the user changes the default view away from the icon view back to list or column. There is zero reason to keep the cache engaged if the user has stopped using it. That is just lazy program design.

And you are right, most people wouldn't notice as the average user probably doesn't know Activity Monitor even exists, but that's why folks who DO know it's there and how to use it should be posting about what they see there whenever there is an anomaly. That way when the naive user has an issue and starts a seach for "Finder crash" and there have been posts about it at sites like this one, they find that there is a workaround of either a Terminal command, or a Force Quit from the menu bar, that can be used periodically to clear this cache and prevent a crash or whatever happens. To me, ignoring the issue, or dismissing it as immaterial or inconsequential is a disservice to those naive users.
 

IWT


Joined
Jan 23, 2009
Messages
10,292
Reaction score
2,231
Points
113
Location
Born Scotland. Worked all over UK. Live in Wales
Your Mac's Specs
M2 Max Studio Extra, 32GB memory, 4TB, Sonoma 14.4.1 Apple 5K Retina Studio Monitor
Thank you, Jake, for your courtesy in replying. Much appreciated.

Ian
 
Joined
Feb 1, 2011
Messages
4,435
Reaction score
2,153
Points
113
Location
Sacramento, California
...There will be those folks who deny that anything is wrong, that Apple is perfect and too smart for us poor dumb users to understand. They will use this report from Apple as justification to do victory laps waving the "Apple is perfect" flag.

I don't believe that "Apple is perfect." I DO believe that Apple's legions of elite programmers are quite a bit smarter than you or any one of us. Probably any ONE of them is smarter than you or any one of us. Probably any ONE of them is smarter than Hoakley, who you seem to get all your info from.

I've been reading articles on how Apple's memory management in the Mac OS has been evolving for many years now. It's pretty darn impressive. Apple, for instance, started including memory compression in the Mac OS at least half a dozen years ago. Long time Mac users will recall RAM Doubler, a third party product for the Mac that made the Mac's memory more efficient. Now a more advanced version is built-in. The Mac OS's memory management has been taking great leaps in development with each new verion of the Mac OS for a long time now. Go back and read, for instance, the Ars Technica articles for each new version of the Mac OS, for the past decade. You can see significant advancements made with each new release.

...The average user may not notice this creeping usage of wherever that cache may be until the system is overloaded and crashes...

And how many Macintosh users are reporting that their Macs are running out of memory and crashing? We are right now on a discussion forum with over a quarter million users. As far as I can see, not a single one of them is experiencing out of memory errors and crashes. The only time I ever hear of a user getting out of memory errors is when they have allowed their hard drive to become too full, and there is no longer any space for the OS to write virtual memory. And the latter isn't a common occurance, it predictably only tends to happen when the user was too frugle and purchased an SSD with their Mac that was way too small for their needs.

As far as "crashing" goes...now that I think of it, I just about never hear of anyone's Mac crashing anymore, for any reason. Not for years now. I can't remember the last time that one of my Macs actually crashed. Even my oldest Macs.


...I don't like the design. It's stupid. I understand the principle of the cache, but with the memory speeds and the retrieval speeds from internal storage on the new Apple Silicon, the whole argument that somehow this cache speeds up Finder is very thin.

I think that the concept is not only not "thin" or "stupid", but that even an average user can understand it and understand its value. Retrieving data from RAM is several times faster than retrieving it from storage. This is the case even if that storage is an SSD. (An SSD is much faster than a rotating disk hard drive, but still several times slower than RAM.) If the OS finds that there is free RAM just sitting around doing nothing, the OS will start caching things. For instance, it will cache an entire Finder window full of icons. It is a good bet that the user will go back to the Finder at some point and open that window again. When they do, if that window is cached, it will open faster because the data is retrieved from RAM rather than having to access it from the drive. The user may go back and access that window several times; each time that they do, the cache will have made it open faster. That's an overall increase in performance, and users can feel that.

Further, there is no reason why the OS needs to release such a RAM cache immediately. The cache speeds the functioning of your Mac as long as it exists. It doesn't need to be released until your Mac has other, more immediate, needs for that bit of RAM.

I have a lot of respect for Hoakley. He writes some fascinating articles. But he's not perfect, and he tends to sometimes be too negative, too narrow minded, and overly dramatic. I think that it's a mistake to have him as your only source on certain issues.
 
Joined
Sep 9, 2009
Messages
13
Reaction score
5
Points
3
Your Mac's Specs
2019 27" iMac, 3 GHz i5, 40gb RAM, 1TB Fusion int, 46TB ext drives, Catalina 10.15.7
Just to add my "2 cents"to this discussion. I've been experiencing frequent crashes the past couple of months on my late 2019 27" iMac with 40GB RAM. Now that I think about it, these crashes have increased and occurred after I have used the Gallery view a few times during the day/week. Don't know if this a coincidence or the problem being discussed. But the iMac has been rock solid up until I started editing, sorting and deleting duplicates in my photo files using Gallery view. I've started to use the Cocktail app to clear caches and do a system restart at least once a week which seems to help.
 
Joined
Feb 1, 2011
Messages
4,435
Reaction score
2,153
Points
113
Location
Sacramento, California
I've been experiencing frequent crashes the past couple of months
I'm happy to help you troubleshoot this, if you like.
on my late 2019 27" iMac with 40GB RAM.

That's a lot of RAM. I'm guessing that you installed a third party RAM upgrade, and likely did it yourself?

Now that I think about it, these crashes have increased and occurred after I have used the Gallery view a few times during the day/week. Don't know if this a coincidence or the problem being discussed. But the iMac has been rock solid up until I started editing, sorting and deleting duplicates in my photo files using Gallery view. I've started to use the Cocktail app to clear caches and do a system restart at least once a week which seems to help.

It used to be fairly common to hear about Mac users experiencing crashes. The reports were all mostly the same. The user had a Mac that was dead stable, but then the user did something that was a bit RAM intensive, and *boom*, their Mac crashed. And the problem was repeatable using the same sequence of events.

This is indicative of your RAM filling up, and when a certain register is accessed, that register, being corrupted, causes your Mac to crash. This used to happen because folks would purchase third party RAM upgrades, install them themselves without properly grounding themselves, the RAM module would suffer from a tiny imperceptible static charge, and in time the module would go bad. It's not a coincidence that once Apple started soldering-in RAM in new Macs from the factory, and making it impossible to upgrade RAM yourself, just about all reports of crashes ceased. (I've been told that is why Apple stopped making RAM user-upgradeable. It's not because it's a conspiracy to make you pay Apple, and not a third party, for additional RAM, but because users were botching their RAM upgrades so frequently it was damaging the Mac's reputation for stability.)

So, what you should probably do is to test your RAM. You can run Apple's Apple Diagnostics to do so:

Apple Diagnostics (free)
https://support.apple.com/en-us/HT202731

Unfortunately, Apple Diagnostics doesn't do as comprehensive a job as one might like. If you are still running Mojave (which came with your Mac), you can run this excellent free product to do a comprehensive test. Unfortunately, it has never been upgraded to support 64-bit. So if you have upgraded your OS past Mojave, it won't work and there is no free/easy equivalent.:

Rember (free)
http://www.kelleycomputing.net/downloads

You can also test your RAM by removing all third party RAM (except for the Apple-supplied RAM), seeing if the problem is gone, and if it is you can re-install each module one at a time until you find the one that re-introduces the problem. Once you find the problematic module, you can likely return it to its vendor for a replacement. Most good RAM vendors have a lifetime warranty.

Please let us know how things go.
 

Rod


Joined
Jun 12, 2011
Messages
9,704
Reaction score
1,892
Points
113
Location
Melbourne, Australia and Ubud, Bali, Indonesia
Your Mac's Specs
2021 M1 MacBook Pro 14" macOS 14.4.1, Mid 2010MacBook 13" iPhone 13 Pro max, iPad 6, Apple Watch SE.
Jake, this has been a fascinating discussion. I have read all the posts and attached articles and I'm truely puzzled as to why the cache would work that way. I didn't mean to make light of the issue in my post # 2. This is a weird, seemingly unnecessary action performed by the OS and really needs explaining. I'm sure you are right, the average user will be totally unaware of this until a Finder crash then be at a loss as to why or how to fix it. Below is a screen shot of my Memory right now.

Screenshot 2023-12-28 at 11.03.41 am.png

As you can see Finder is using very little Memory at the moment but as I said I only use Columns in List View.
I don't really understand the difference between App memory and Wired Memory I only go by the total Memory Used but as you can see Memory Pressure is very low.
The 3 day cache clearance is also very odd, I too thought killing the Finder would recover the space, would turning the device off clear the cache?

There are also a number of apps that "free up" Memory such as Clean My Mac X which we both have but my wife uses more than I. Apparently she sometimes finds her 2018 MBP (8GB RAM) slows down to an almost unusable state and she uses the CMMX Helper Utility to free up memory which fixes the issue instantly. I don't have the "helper' running but she does and when low on memory it notifies her and offers to fix it. Who knew? I tried it myself and Available Memory increased to 11.1 see below.

Screenshot 2023-12-28 at 11.23.04 am.png

Needless to say I never do this and I understand in most cases it would be pointless as the Memory used will just increase again as I continue to use this browser and other active apps and processes.

So, to sum up I agree that this behavior seems unnecessary and even stupid design, your comment, "in a good design Finder should release that cache as soon as the user changes the default view away from the icon view back to list or column." is spot on.

The real problem is most people wont know it's happening until it causes a problem and if they are not my wife they wont know how to fix it.
 
OP
MacInWin
Joined
Jan 1, 2009
Messages
15,512
Reaction score
3,876
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
The 3 day cache clearance is also very odd, I too thought killing the Finder would recover the space, would turning the device off clear the cache?
Apple called it 2-3 days before Finder releases the cache, so not a fixed timer anywhere. Maybe Sonoma rolls some imaginary dice to select the time? (Before anybody responds, that was a joke.) The Terminal command "killall Finder" does recover the space, as does using the apple icon upper right and then Force Quit to restart Finder. And turning off the device, or even rebooting clearly recovers the cache as well.

As for using any tool to clear memory because of this anomaly, I don't think that's really needed. As I said in post #4,
In my own testing, some parts of Apple's explanation don't seem to hold up. I noticed in my own testing that the upsurge in memory reported by Activity Monitor as being used by Finder was there (I got it to be over 2GB by using multiple folders to increase the number of images it had cached), and it stayed around for a long time, but that at the same time, Activity Monitor reported a DECREASE in Memory Used and a DECREASE in Cached Files space. Then, when I killed Finder to recover the space, there was ZERO change in Memory Used and Cached Files, even though Finder had released almost 2 GB of memory, supposedly. Also, the used storage space on the SSD portion of the fabric storage was unchanged, meaniing these images were not, appparently, stored on the SSD.
So this growth in Finder memory consumption isn't coming out of main memory, or swap memory, or SSD storage, at least as reported by Activity Monitor. Maybe there is some space in an alternate Universe where Apple is storing these icons (another joke), but it is not anywhere that the user can see it in this universe. So, there is either a bug in FInder in not releasing this memory as it should, or a bug in Activity Monitor that is missing this use of memory, or a bug in APFS where the storage is not being reported properly, or Apple made up the story that it was by design.

Bottom line is that Apple doesn't seem to be playing straight with us over this, which makes one wonder what else they may be doing.

But the good news is that there are not a lot of protests in the internet universe about running out of memory, so no reason to storm Apple headquarters, yet.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top