Another Finder memory leak in Sonoma

Following on from the previous memory leak I have demonstrated in the Finder in macOS 14.1.1, here’s a second, discovered by Kate, which might have a common root cause.

This is even simpler to demonstrate:

  1. Open Activity Monitor and select its Memory view, then order the list of processes by the amount of memory used.
  2. Open a Finder window, perhaps in column view to start with, and note the amount of memory taken by the Finder.
  3. Navigate that Finder window to display your main Applications folder, or any other folder with plenty of files, particularly images such as JPEGs.
  4. Switch the Finder window to Icon view and note the change in the Finder’s memory used.
  5. Increase the size of the icons displayed in that window by dragging the control at the right of its Status Bar to the right, until the icons are very large. Note Finder memory.
  6. Scroll through the contents of the Icon view window, noting memory changes.

With little effort, over a minute or two of similar actions you should see the Finder’s memory climb to over 1 GB. However, changing the Finder window back to column view or closing it doesn’t free that memory up, even days afterwards. The only way to return the Finder’s memory use to anything approaching normal is to relaunch it from the Force Quit Applications dialog.

This memory leak has apparently been reported to Apple in previous versions of macOS, but hasn’t been fixed yet, and persists into Sonoma. I have tested VMs of macOS 13.6 and 12.6.1, and found it to be present in both of them, confirming that it has been present in macOS for some years now. As the Finder’s gallery view is affected by the previous memory leak, this means that two of the Finder’s four window display modes are now afflicted with memory leaks, which isn’t a good average.

Gallery and Icon view have common features in their display of large numbers of custom icons or QuickLook thumbnails at the same time. Although there’s no evidence in Activity Monitor that any QuickLook process has a memory leak, I wonder whether these two leaks have a common cause in the way that the Finder is handling those thumbnails, perhaps failing to deallocate the memory they use during display.

For those that do, happy Thanksgiving!

I’m very grateful to Kate for telling me about this memory leak.