惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家
V
V2EX
Jina AI
Jina AI
V
Visual Studio Blog
有赞技术团队
有赞技术团队
博客园 - 司徒正美
博客园 - 叶小钗
The Cloudflare Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
Google Online Security Blog
Google Online Security Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News and Events Feed by Topic
N
News and Events Feed by Topic
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
SecWiki News
SecWiki News
博客园_首页
罗磊的独立博客
量子位
Latest news
Latest news
I
Intezer
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Last Week in AI
Last Week in AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
S
SegmentFault 最新的问题
S
Security Affairs
阮一峰的网络日志
阮一峰的网络日志
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News | PayPal Newsroom

Comments for The Eclectic Light Company

Should you try Golden Gate beta? Solutions to Saturday Mac riddles 367 In the shadow: Diego Velázquez Comment on Last Week on My Mac: Freshen up your documents by David Comment on Happy 250th birthday America 2 by mac Happy 250th birthday America 1 Brushstrokes: Portraits 1760-1877 Spotlight and Core Spotlight are different Comment on Sort order, collation and the Finder by eyelessjerry Comment on Apple has just released macOS 26.5.2 Tahoe by Derek Currie Great Ladies of Impressionism: Marie Bracquemond Comment on Get more from your Mac’s log by extending its duration by John Gilbert Comment on Keep your Mac cool using physics by F Portraits of trees: Coppices and pollards Comment on Firmware has become complicated again by John Woods Comment on Logistician 1.2 fixes a couple of bugs by info395288a4d1d Comment on What does Activity Monitor measure? by hoakley Last Week on My Mac: Spotlight on semantics An American in Paris: paintings of Henry Ossawa Tanner 1902-1930 An American in Paris: paintings of Henry Ossawa Tanner 1880-1902 Great Ladies of Impressionism: Berthe Morisot 1874-1891 What to do with a hot Mac Deprecations and removals from Golden Gate Brushstrokes: From El Greco to Rembrandt Portraits of trees: Dutch Golden Age How to get the most from SilentKnight 3 Comment on Hero or hooligan: Achilles becomes the warrior by Deborah J. Brasket Solutions to Saturday Mac riddles 365 Comment on SilentKnight 3.0 for Apple silicon Macs running Sequoia and later (full release) by michaelriccioli Comment on Last Week on My Mac: Uncompressed compressed files by fds Comment on Explainer: Memory by jzonedotcom Comment on Colin Campbell Cooper painting America: 1896-1910 by House of Heart Brushstrokes: 16th century SilentKnight 3 second beta adds text and JSON reporting In the shadow: Caravaggism What to do with your encrypted HFS+ disks First beta-test version of SilentKnight 3 for Apple silicon Macs Hero or hooligan: Jason and Medea Comment on Fix documents that won’t open as expected using Quarant2 by EcleX Last Week on My Mac: The mystery of Safari’s Web Archives Last Week on My Mac: Why is it so hard to open a document? Explainer: Disk encryption In the shadow: Caravaggio Brushstrokes: innovators of the first century Changing Paintings: 36 Theseus and the Minotaur macOS virtualisation is leaping forward in Golden Gate Why can’t Preview open that PDF? Crossing the Golden Gate, Intel support, and an update to SystHist Reading the Finder’s Get Info dialog In memoriam Mary Cassatt: 2, 1880-81 Last Week on My Mac: What’s in a name? Explainer: Getting a location Get more from Get Info and the Finder’s contextual menu Stop your photos revealing your location Have you saved thousands of versions? Versatility 1.2 might be what you need Apple has released an update to XProtect for all macOS Apple has released macOS Tahoe 26.5.1 Comment on What Location Services do in macOS by Tristan Hubsch Comment on Protect files with the Locked or Immutable flag by markbot2zero Portraits of trees: Introduction Which tasks require mains power? Comment on Online reference to external displays for Apple silicon Macs by Brian What’s in that phishing email? How to search document versions Rubens’ Peace and War Comment on Last Week on My Mac: Syncing metadata in iCloud Drive by hoakley A weekend with Misia: 2 How to search Time Machine backups? Medium and message: Pottery Hero or hooligan: Theseus and the sandals How QuickLook provides thumbnails and previews Hunting extended attributes with an update to xattred Saturday Mac riddles 360 Comment on How to preserve versions, and how to create versioned PDFs by markbot2zero Comment on What gets synced in iCloud Drive? by hoakley Solutions to Saturday Mac riddles 359 Last Week on My Mac: snapshots, the elephant in APFS How to check whether Spotlight is getting the right metadata macOS Tahoe no longer fully supports Time Capsules The bicentenary of Frederic Edwin Church: 1857-77 macOS virtual machines and audio-video syncing Comment on Use Finder tags for categories by Chuck Last Week on My Mac: Dependency and skill fade Comment on Virtualisation on Apple silicon Macs is different by AndyS Painting Pandora and her box: 1883-1919 Mac Easter eggs Painting Spring blossom 2 Comment on The macOS Natural Language framework and Nalaprop by Ingo Comment on The MACL extended attribute by hoakley On Reflection: Cézanne Privacy: Which folders are protected in Tahoe? Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Last Week on My Mac: Root cause analysis and ClickFix Why you can’t trust Privacy & Security How can I now have two apps named Pages? How to survive the loss of Rosetta Use Fallback Recovery on Apple silicon Macs Clean install macOS
What can you do when an app uses too much memory?
hoakley · 2026-06-20 · via Comments for The Eclectic Light Company

The most common causes for Macs to perform poorly are excessive memory use and excessive CPU load. Although they’re easy to distinguish in Activity Monitor, if your Mac has a cooling fan you should be able to tell them apart before you even look at the figures there: high CPU load is usually accompanied by the sound of the fans running up, while high memory use isn’t. Poor performance means that actions that are normally instant result in a pause, sometimes long enough to show the spinning beachball, and repeatedly seeing the beachball should send you straight to Activity Monitor to look for a cause.

In Activity Monitor, click on the Memory tab at the top of the window, then click the column header Memory to sort the entries with the largest memory use at the top. In the View menu, ensure that All Processes is ticked, or system processes may be hidden. Confirm the window title reads Activity Monitor All Processes.

memory01

App memory leak

Excessive memory use doesn’t necessarily mean there’s a memory leak: it may just be that what you’re doing in that app requires many GB of memory. To distinguish these, as soon as you can, save your work and close that document in the app that’s using all the memory. If that results in memory use falling back to what seems normal, then this isn’t likely to be a memory leak, but simply reflects the demands your document is placing on the app.

App memory leaks in user space are readily identified using Activity Monitor or a substitute displaying accurate figures for app memory use. An app that might start up using a few hundred MB of memory grows steadily with time and usage until it reaches many GB, by which stage the app’s performance normally suffers, as much of that may be virtual. This could well be sufficient to push overall memory use into the red zone.

Looking at the detail at the foot of Activity Monitor’s window, you’ll see a value for the physical memory installed in your Mac, how much memory is used, whether there are any files cached from disk into memory, and any swap memory usage. Memory used is further broken down into App and Wired memory, and the amount that’s compressed to save space.

macOS supports the extension of memory to include disk storage, so-called virtual memory. This is managed by a combination of hardware and software, enabling some of the memory being used to be swapped out to disk, rather than occupying physical memory. There are complex trade-offs in putting what should be in physical memory into disk storage, and how much physical memory to keep free. These are normally managed expertly by macOS, and shouldn’t be meddled with.

With Activity Monitor still open, use the app as you would normally. In this example, the figures shown are for the Finder in Monterey.

memory03

Memory used by the app quickly starts to climb, here reaching over 1 GB, and continues to rise as long as you continue to work in that app.

memory05

In this case, memory used by the Finder reached a maximum of 3.11 GB. Not only that, but closing the app’s window didn’t recover any of that used memory: from now on, that’s the app’s starting point. Continue to work in that app and the memory used will rise again, and never fall. It will do that, voraciously consuming memory, until you quit the app, or in this case restart the Finder.

When you open that app again you’ll see how little memory it should have been using. Although it can’t run for long in as little, both the app and your Mac will be able to run much faster again, with ample free memory.

Most app memory leaks are simple programming errors on the part of those coding that app. The use of modern high-level programming languages like Objective-C and Swift has reduced these, as most memory allocation and freeing is handled automatically, so there are no calls normally required to deallocate memory. This becomes more complex when an app uses macOS frameworks, as some of the older frameworks still rely heavily on the code manually deallocating memory when it’s no longer required, and that can catch developers out. The frameworks can also change, and suffer their own bugs, so there’s ample scope for everyone involved to shoulder the blame.

For the user, there’s only one way to live with app memory leaks: quitting the app should return all the memory that was allocated to it. If a leaking app has reached (say) 20 GB of memory used, save your work, quit the app, and open it again. While this isn’t convenient, it does allow you to continue working, as does switching to another app which can do the same job. Always let the app developer know, so that they can discover the cause and fix it.

The case of the Finder in Monterey shown above is of particular interest, as that looked like a leak, but in fact was intentional caching behaviour, most prominent when viewing many images in a Gallery view window. The Finder automatically flushed those huge caches under memory pressure, or after a period of about two days. To confirm that behaviour you needed to track the Finder’s memory use for over 48 hours. Since then, on Apple silicon Macs running Tahoe at least, the Finder no longer does that, presumably relying on disk caching instead.

These days the most likely offenders seem to be Pages and sometimes even Mail. Many users have reported that leaving large documents open in Pages, or large mailboxes in Mail, can bring their memory usage up to 9 GB or more, with obvious effects on performance. The best workaround is to close open documents, quit the app, and check whether that memory is returned fully. If it isn’t, then restarting may be necessary.

Kernel memory leak

Memory problems with apps can almost invariably be solved by quitting that app, but those occurring in the kernel are more serious, as they’re likely to result in a kernel panic, normally their first and only sign. They’re not only more serious and harder to detect, but there’s usually nothing the user can do apart from restarting the Mac and capturing a panic log.

Some do arise in third-party kernel extensions, so your next action should always be to disable the use of third-party kernel extensions in Startup Security Utility, in Recovery Mode, and return an Apple silicon Mac to Full Security. In Intel Macs, you’ll need to uninstall the kernel extension, as their Secure Boot doesn’t control the loading of third-party kernel extensions.

The last major kernel memory leak occurred in the Catalina 10.15.6 update in July 2020, right at the end of its development cycle. Although kernel memory leaks are very rare in release versions of macOS, they could occur in any version, not just major updates.

Most kernel memory leaks occur in special pools of memory reserved for ready use by the kernel and its extensions, known as Mach zones. When a user process wants some memory, it asks to be allocated some by the kernel using a call such as malloc(); when a kernel extension wants some memory allocated to it, it uses a different call such as zalloc() or kalloc(), which aren’t available to user processes, so that the memory is allocated from that reserved for kernel mode processes. These are similar to what are known as memory caches in Linux, or Pools in Windows.

Mach zones aren’t normally open to inspection by the user, except with the
sudo zprint
command, which provides a vast list of each of the Mach zones in use and figures for their usage. These have changed considerably since the days of Catalina, making it hard for even advanced users to see the wood for all these trees.

machzones1

This is just a brief part of a long list of all the zones, giving the size of the memory blocks it contains, its current total size and the maximum, the current number of elements and the maximum, and more.

Over time, even a small kernel memory leak can progressively consume all the elements currently allocated within one or more of these zones. This is detected as the zone size in use approaches its maximum, the high water mark. Some zones are expandable, and macOS can then allocate additional memory from a dedicated zone_map area to expand that zone. Rarely, such additional memory can be obtained from memory outside the zone_map, but in most cases that’s not possible, and the eventual result is zone_map_exhaustion – zone memory has run out, even though some zones still have memory available. Thus, a memory leak in a kernel extension can run the kernel out of zone memory, something you wouldn’t notice in Activity Monitor, which is concerned with the management of user memory.

As always, following a kernel panic, the most important tool is the panic log. At the very top of the log, following the first word panic, the log should reveal that a memory leak is to blame:
panic(cpu 8 caller 0xffffff80017729eb): "zalloc: zone map exhausted while allocating from zone kalloc.12288, likely due to memory leak in zone kalloc.48 (6586956000 total bytes, 137228148 elements allocated)"@/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-6153.141.1/osfmk/kern/zalloc.c:3627

How to deal with a kernel panic explains this in more detail.

Summary

  • App memory leaks are a relatively common cause of poor performance, diagnosed using the Memory pane of Activity Monitor.
  • A memory leak occurs when an app uses memory but doesn’t return it when it’s done; it’s marked by rising memory use in Activity Monitor, which doesn’t get freed until you quit the app.
  • Work around an app memory leak by saving your work and quitting the app before its memory use becomes excessive.
  • Always report an app memory leak to its developer so they can identify the cause and fix it.
  • Kernel memory leaks are rare, and most likely to lead to a kernel panic. The panic log should then be diagnostic.