Continued corespotlightd process CPU overload issues

I am wondering if anyone has discovered any new ideas for stopping the corespotlightd process from hogging the CPU. According to Activity Monitor, the corespotlightd process often occupies more than 100% of the CPU load, sometimes spiking as high as 400% on my M2 Ultra Mac Studio. This problem has become so severe that it often pinwheels under normally non-intensive tasks. It can cause the video to flicker on my Studio Display. In one case it caused my Mac to kernel panic (crash).


I encountered this bug only after installing Sequoia 15.2, but having researched this issue extensively, I find that Mac users have identified it since at least macOS Ventura. So here are some solutions we don't need to hear again:


Reindexing Spotlight by adding and removing volumes in Spotlight Privacy. This provides relief only temporarily. Within hours the process is again grinding the Mac to a halt.


Killing the corespotlightd in Activity Monitor. Again, this is at best only a temporary solution as the process will reinstate itself.


A "clean" install of macOS. First of all, no such process really exists. The OS recovery process simply reinstalls a new copy of the System files. Nobody reports this as a fix. An internal drive wipe and reformat, and restore from Time Machine is also unlikely to help, as it simply returns your Mac to its previous state. If the corespotlightd problem results from a corrupted file, the problem will likely simply be recreated in your reinstall. "Nuke and pave" might solve the problem if it caused by a format or directory issue on your startup volume. This does not seem to be the case, but if anyone has permanently cured the problem by this method, please report it.


What we do need to hear is from anyone who has spent time with Apple Support on this issue and been provided with solutions that actually work, or has new ideas about what causes it. Feels like we're on our own here, since Apple seems to be stumped.



Posted on Dec 19, 2024 11:21 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 31, 2024 11:01 PM

On my M4, tried

while true; do killall -9 corespotlightd 2>/dev/null && sleep 0.5; done &

this seemed to get rid of the process if run for a few seconds. But then opendirectoryd comes up and consistently uses about 20% of cpu.

305 replies

Feb 9, 2025 01:07 PM in response to fronesis47

Having tried this myself, I must report a non-confirmation. I opened a large Pages file and watched the Corespotlight folder file size. It started out at 60.35 GB and remained exactly this size after a half hour, even though the process showed as being very active (100+ percent) for part of this time. I don't doubt that deleting it has a temporary effect but it's also clear that this folder growing in size cannot be triggered predictably by opening a Pages file.

fronesis47 wrote:

1. After the better part of another day thinking about and troubleshooting this issue, I am convinced that Eric Murphy's earlier hypothesis is correct. There's a bug in Sequoia, which anyone can replicate by following these 2 steps:
Open a Pages file (and keep it open).
2. Watch the size of this folder balloon: ~/Library/Metadata/Corespotlight

The larger that folder gets, the more likely it is that the corespotlightd process will start taking over the CPU and causing slowdowns for the Mac user. The corespotlightd process is what gets most people's attention, but it's only a symptom of the underlying problem whereby the spotlight processes (mdworker, etc.) write enormous amounts of data into the corespotlight subfolders.

The bigger the Pages file the quicker the folder grows in size; the more frequently one uses Pages, or leaves Pages files open, the worse the problem.

There is no fix until apple implements one, and the only viable workaround is to monitor the size of that folder and occasionally delete it.

One silver lining: it's not clear to me that there is any need to delete your spotlight index, to turn indexing off and on, etc. The problem stems from the size of that metadata folder, and you can alleviate the problem by deleting the folder. In my experience (having deleted the folder many dozen times), spotlight works just fine without rebooting, reindexing, or anything else.

I came up with my own way of dealing with this issue: I wrote a simple shell script that trashes the corespotlightfolder; then I added that as a service in launchd so that it can run regularly (maybe every 2 days).


Feb 9, 2025 01:43 PM in response to fronesis47

Earlier in this discussion it was established that iCloud is not the culprit. Files that will trigger the problem will do so whether they are stored locally or in iCloud. I meant corespotlightd because this the process I see as being hyperactive when the CPU is overloaded. Either way I have had this large Pages file open for over an hour now and the file has not grown at all. Unfortunately all of the theories we've come up with so far are incomplete or flawed. They only seem to work for some users some of the time.


fronesis47 wrote:


Mitch Stone wrote:


Having tried this myself, I must report a non-confirmation. I opened a large Pages file and watched the Corespotlight folder file size. It started out at 60.35 GB and remained exactly this size after a half hour, even though the process showed as being very active (100+ percent) for part of this time. I don't doubt that deleting it has a temporary effect but it's also clear that this folder growing in size cannot be triggered predictably by opening a Pages file.
1. This is helpful. Some key questions:
When you say "the process showed as being very active" do you mean corespotlightd? For the record, when I repeatedly watch the corespotlight folder grow (with a Pages file open), it is NOT associated with the corespotlightd process. To the contrary, it's mdworker and mdstores that are writing all the data to that folder.
2. Do you have optimize iCloud storage turned ON, on your machine?

On my Mac with optimize OFF, the corespotlight folder always grows with a Pages file open. But on my Mac without optimize storage ON, I do not see the growth as consistently.


Feb 10, 2025 09:20 AM in response to PolyRod

PolyRod wrote:

From my perspective, Pages seems to fail when, after making an edit which might itself be trivial, I scroll. Pages disappears, then I get the windows asking if I want the report to go to Apple (and I always do allow that), and if I want to let Pages restart.

Time after time, Pages only loses the tiniest bit of editing. (Hats off to Apple on that score.) But it takes an annoying time to be able to get back to editing the document again.

I'm assuming you've tried the fix of deleting the Spotlight folders from your ~/library/metadata/ folder? If so, has the problem with Pages persisted even after doing so?

Feb 10, 2025 11:11 AM in response to ericmurphysf

Nothing in my understanding of this problem, which echoes the conclusion that Eric Murphy mentioned early today (namely, the root of the issue is how spotlight indexes pages documents) – nothing there gives me good reason to believe that this could be fixed server side.


Nonetheless, in the interests of scientific transparency, I have to report that so far today the core spotlight folders (in ~/Library/Metadata) are not growing in size at all, despite my having a Pages document sitting open. This is the case on my M2 Pro through 3 hours of work this morning, and repeated on an Intel iMac through another 3 hours this afternoon. In both cases the core spotlight folder is not budging, while a Pages document remains open.


I can't explain it. Could just be random. But it seems conspicuous to me that the problem seems to have disappeared not long after sugarskyline's long support session with a higher-up apple tech. ??

Feb 10, 2025 12:33 PM in response to sugarskyline

sugarskyline wrote:

Is it accurate to say though that everyone here was having a good time before Sequoia 15.2?

No. I first started running into problems in mid-December, when I think was still running 15.1, and looking at the metadata files written before that time I can see that they were starting to grow not long after I installed Sequoia. Moreover, online research suggests users were running into this issue as early as macOS Ventura, although it appears to have gotten much more prevalent after Sequoia was released.

Feb 12, 2025 09:41 AM in response to Bets



Google around a bit and you will find as I did that reports of the corespotlightd process running amok go back at least as far as Ventura. Perhaps not to the extent we are seeing it now, but certainly it is not entirely new to Sequoia and its more recent iterations. I mention this because if Apple is monitoring this discussion, it seems to me their engineers will have dig back further into their code base than Sequoia to find the bugs.


Bets wrote:

@sugarskyline. Yes, I'm pretty sure I didn't have this problem with Pages and spotlight before Sequoia. It's completely out of control on 15.3.


Feb 17, 2025 04:03 PM in response to fcoteb

A couple of other observations that are specifically about Spotlight's effects on storage space and battery life on M-series Apple laptops:


First: it seems that while Spotlight processes definitely pile up quite a bit of metadata on M-series Macs, including laptops, it's not as severe as on Intel Macs. One of the reasons it seems to be less severe is that while on Intel Macs I have never seen the CoreSpotlight folders referenced on this thread ever decline in size unless I manually remove data, I'd say that I see day-to-day declines on M-series Macs about 40% of the time. Sometimes the declines are as much as 50% from the previous day.


Second: even though Spotlight metadata does not accumulate on Apple Silicon Macs the way it does on Intel Macs, Spotlight in combination with Pages seems to have a dramatic effect on battery life while the system is ostensibly "sleeping."


If I have a Pages document open on my M2 Max MBP overnight, that will drain the battery by between thirty and forty percent. If I quit Pages, I won't typically see any drain overnight, i.e., the battery will still be at 100% if I charge it after my last use of the day. There doesn't seem to be a way to prevent M-series Macs from doing all kinds of stuff while they're ostensibly asleep with the lid closed ("Power Nap" doesn't seem to be a function you can disable), but in any case Spotlight appears to continue to index the filesystem even while the laptop is asleep if a Pages document is open on it.

Feb 18, 2025 04:56 PM in response to fronesis47

This is a serious problem, Apple. I have a new, basic MBA M3 and it is LAGGING terribly, to the point of being extremely annoying. I have turned off AI, turned off Spotlight on all the folders, put user files into the 'secure' (not indexed). I turned off Spotlight in the terminal (sudo mdutil -i off), force-killed it repeatedly using the Activity Monitor, yet corespotlightd repeatedly restarts. A zombie Spotlight that keeps stealing my CPU is very aggravating, not what we expect or paid for.

Feb 19, 2025 07:44 AM in response to fronesis47

fronesis47 wrote:

2. I can now report back on my own experiment: I've got a script that runs every 2 or so days and automatically deletes the corespotlight folder. I've now been running for more than a week and (knock on wood) everything is fine. I never notice any issues deleting the folder, and by deleting it every couple of days it usually stays under 2 gigs in size (though I've seen it as high as 5 gigs). In my experience, the problems don't start until the folder gets north of 25 Gbs.

What's odd about these CoreSpotlight folders is how little effect on Spotlight functionality deleting them has. It does seem like for the first ten minutes or so Spotlight will not return results (and stuff like Smart Folders in Mail don't work properly). But after ten or fifteen minutes Spotlight results are fine.


So it seems like macOS is expending significant system resources in terms of both storage space and CPU time, to produce metadata that is of very limited utility.

Feb 22, 2025 02:41 PM in response to ericmurphysf

I have iMac 27" intel. I delete System Data related to Library>Metadata>"CoreSpotlight" and "Spotlight KnowledgeEvents" EVERY NIGHT (and delete from Trash, too), or I hit the 50GB threshold that affects pace of storage accumulation and performance significantly. Thanks to this Group for this bandage to keep operational.

My tech knowledge is maxed out at starting my lawnmower. Amazed that I found this group. Apple Support let me down badly. At year end, I began to get pop-ups about "Your system has run out of application memory." Apple support baffled. Ultimately they had me delete and refill MacOS and all data, which is still causing me grief. All for nothing. Sigh...

Feb 25, 2025 11:48 AM in response to fronesis47

The inconsistency of this problem from day to day and Mac to Mac is crazy. I am presently not experiencing it on my M2 Ultra Studio. I never experienced it on my M1 MBA, even when opening the same Pages file on it as on the Studio. All this said, I am not convinced that preference files are not implicated, because the OS writes to some them, including the spotlight plist file. I suppose if this bug was a simple one Apple would have fixed it already.


fronesis47 wrote:

For those who have been following the entire thread, I have some new data. It doesn't solve anything, but I thought I'd share.

For me the problem was replicable on 3 different machines, with these CPUs: M2 Pro, M3, Intel i7.

A week ago I upgraded my Mac mini to an M4, and on this machine I cannot replicate the problem. I've had 3 large (for me) Pages documents open for the past 2 days, and during that time the corespotlight folder has gotten smaller. It's currently under 2 gigs. At one point while writing intensively for many hours, the folder got as large as 5 gigs. But then I left the machine alone for a few hours (with Pages documents left open) and the folder got smaller.

On my other machines I never recall the folder getting smaller if Pages docs were open.

I should add that I DID use migration assistant to set this machine up, so it seems less likely that the "fix" was avoiding a problematic setting or preference file.


Feb 26, 2025 07:35 AM in response to fronesis47

After intense guru meditation, I believe this is related to version history of the pages document. I didn't know Pages was doing version history, but I'm not surprised, and am grateful, except for this behavior we are all lamenting. Pages->file->revert to->show all versions produces a mighty number of versions, each with small incremental changes (which is desirable behavior, mind). I suspect that some bug is triggering some weird loop therein that spotlight can't contend with. Next stop on the troubleshooting train: exclude ~/Library/Metadata from spotlight. Why would we need spotlight to index that anyway for routine operation?

Feb 26, 2025 05:38 PM in response to Mitch Stone

Could you please define large in "large Pages document"?


I had trouble with Pages files 3-6 MB. Since then, I deleted the metadata several time, narrowed Spotlight's scope, eventually to zero, turned off AI, and even switched to Word for a while. Obviously rebooted. Finally the CPU settled down. Now, I have turned Spotlight back on, turned on AI, and gone back to using Pages with the same 3+ MB files, so far no CPU problems. Magic!? (The System data is ridiculously large at 100 GB, but that is not a problem compared with the lag from an over-busy CPU.)

Mar 6, 2025 11:20 AM in response to sugarskyline

Did you try my suggestion? For me, it actually did help a lot. I'm not sure I understand the resistance to it, given the simplicity and apparent effectiveness. I'd really like to know if it works as well for others as it did for me.


Also, I realize it's easy to obsess over the Activity Monitor once you are aware of the issue. I sure did. But I would remind everyone that seeing the process spike occasionally in AM is not the issue that drove us to this discussion; it was a noticeable hit to system performance and occasionally even kernel panics. If you are not experiencing either of these issues, then this problem has at least become manageable until Apple figures out a fix.


So (again) my workaround suggestion is: Finder copy the Pages file that produces the issue for you and work with the copy. Give it a try. What's the worst that can happen?

Mar 6, 2025 02:10 PM in response to RThomas

Update - yeah - the mouse update changed functioning only when Pages is not open. Still having lag issues as well as CPU and CoreSpotlight Metadata problems.


For me Pages is a vital tool that cannot be replaced. Dumping the corespotlight metadata one a week or so will have to do until they can do the fix.


REALLY HOPING they are not planning to ditch Pages… it is the most usable program outside of InDesign for my purposes - and InDesign is WAY too expensive!

Continued corespotlightd process CPU overload issues

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.