How to work around Monterey’s Finder memory leak

As you should have heard by now, the latest update to macOS Monterey, version 12.2, still has a serious bug which can cause everything to grind to a halt: it’s a major memory leak in the Finder. This article explains how it affects your Mac, and how you can work around it.

This remaining memory leak is one of at least three found by many users in macOS 12.0.1. Two – one affecting the new coloured cursor feature in Accessibility, the other involving Control Center – are known to have been fixed in 12.1. Unless Apple decides to fix this bug in an earlier patch update, this leak may not be fixed until macOS 12.3, which isn’t likely to be released until April.

The bug

This memory leak appears to affect all models of Mac, both Intel and M1, running any version of Monterey from its initial public release 12.0.1 to the latest update 12.2. As it affects one of the key features of the Finder, if you use the macOS GUI sooner or later you’re likely to come across it, and for some users it’s severe.

It only affects the Finder’s Find command (in the File menu), and doesn’t affect Spotlight itself, or third-party products which use Spotlight search, such as Find Any File or HoudahSpot. If you never ever use the Finder’s Find feature, then you can stop reading here, as you won’t encounter this bug.

When you set a Finder window into Find mode and start typing characters into its search box, the Finder launches an interactive search which hones in more narrowly as you type additional characters. What appears to happen is that each of those search results is retained in memory, rather than being purged when a new search is started. The amount of memory used each time is determined by the number of ‘hits’ obtained at that moment.

For example, let’s say you start typing the word syzygy, which should have very few hits. When you’ve just typed the first character s there are likely to be hundreds of thousands of hits. As those are being delivered to the Finder, its memory use grows rapidly. Add the second character y and the rate of memory use slows sharply, as there are far fewer hits, and after the third character z there should be even fewer.

What should happen is that, as the search is refined, the results of earlier partial searches should be cleared from memory, which should reduce the amount of memory used by the Finder. That doesn’t happen, though, and memory use continues to rise, never to be freed, even when you close that window to finish using Find.

Workarounds

If you’re only an occasional light user of the Find feature, you can use it without the Finder outgrowing your Mac’s memory, provided that your Mac generally has plenty of free memory. Instead of typing search terms one character at a time, you can paste in more specific text which is only likely to return less than a thousand hits, which should only consume around 5 MB each time.

The (literally) big danger is typing one character in and leaving the search to run: do that once, and the Finder’s memory use could readily rise into several GB. When the Finder’s use of memory grows too high for your Mac, before it starts hitting performance, open the Force Quit dialog by pressing Command-Option-Escape, select the Finder there, and click the button to Relaunch it.

memory06

If you can’t be so disciplined, or rely on Find frequently, or if your Mac has more limited physical memory, then there are three main options.

For straightforward searches, use Spotlight from the menu bar, which doesn’t appear to have any such problem.

For more intensive file searches, look at Thomas Tempelmann’s Find Any File (FAF), which costs around $/€/£ 6 direct or in the App Store. This is an excellent utility which does a great deal more than Finder’s Find ever will.

spotplus03

For more sophisticated Spotlight search, including file metadata and contents, HoudahSpot is more expensive, at around $/€/£ 32, is by far the most powerful Spotlight-based search utility, and worth every penny.

spotplus04

Neither FAF nor HoudahSpot has any memory leak, and both work excellently in Monterey.