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

Dec 27, 2024 08:01 AM in response to Mitch Stone

Mitch,

I think you could be onto something here. My brand-new, maxed-out Mac Mini was working perfectly, then after a kernel panic, reboot, and relaunch of all my open apps, corespotlightd started dominating the CPU and causing cursor and data input freezes. Pages.app has an iCloud-resident, password-protected file of text and images that I add to daily and that relaunched as a part of the system reboot. That file is currently 29.5 MB.


After reading your post I closed the large Pages file and after a few minutes corespotlightd dropped off the top of the CPU list in Activity Monitor. I did not delete any SpotlightResources.plist files. When I reopened the large file, corespotlightd again started climbing to the top and intermittent cursor freezes reoccured.


I quit Pages.app and corespotlightd disappeared as did the freezes. Now I've relaunched the app and reopened the large file,. All is well, no cursor freezes and corespotlightd is at 0% of CPU.


Looking at Console.app, I see this in one of the diagnostic reports (date and time concurrent with the freezing issue).

Command:          corespotlightd
Path:             /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/corespotlightd
Codesigning ID:   com.apple.corespotlightd
Resource Coalition: "com.apple.corespotlightd"(849)
On Behalf Of:     445 samples Pages [971] (445 samples originated by Pages [971])
Architecture:     arm64e
Parent:           launchd [1]
PID:              4063


I don't know if any of that is relevant. I speculate (wildly) that spotlight might have been trying to index an open, yet password-protected large Pages file and that was causing the system-wide issues.


The file has been open for 30 minutes and there are no issues and corespotlightd is not showing up on the CPU list.


I hope this helps.

Dec 27, 2024 11:15 AM in response to SBML

I believe I can now safely report that the issue is generically related to how Spotlight handles large Pages documents. I Finder duplicated the shared collaborated document in iCloud, and with collaboration off, roughly 10 minutes after opening the process begins to hog the CPU. Moving the document to a local volume, same results. The problem does resolve much more quickly, and seems less severe with the deletion of the Spotlight plist, so it is definitely worth trying, but obviously this is only part of the issue.

Dec 29, 2024 12:33 PM in response to MgS_2012

I come from that far back as well!


The systems I worked on could originally be single or dual processor, later up to quad. And processor usage for a single process could almost reach 100%. With a maximum across all processes potentially approaching 400% on a quad. Which made sense.


But the precise meaning of 138% is far from obvious. Especially when we need to consider performance and efficiency cores. And how do GPU cores fit?

Dec 30, 2024 07:58 AM in response to Mitch Stone

Mitch, I can reliably reproduce the bug by opening a large (34 MB) Pages file, adding some text then letting the application sleep (TOP command in Terminal confirmed). After several minutes, corespotlightd takes over the CPU resulting in stuttered data input and spaces swaps, and cursor freezes. After quitting Pages the issue resolves after a few minutes. If you're going to open a bug report, I'm happy to submit configuration data and log files.

Jan 1, 2025 06:06 AM in response to Mitch Stone

So … a couple of updates:


1). Talked to Apple Support yesterday. They took lots of notes, and have passed the issue on to MacOS engineering.


2). It’s been 3 days since I turned off Apple Intelligence on my iMac, and it has returned to normal operation - it took about 24 hours for things to settle down (I was seeing spikes in corespotlightd, but it would come down off them). Since then it’s been behaving itself.


3). Regarding the system CPU usage spikes, I was seeing some spikes of processes like kernel_task when things got into a really hairy state. I suspect this is related to resource allocation issues where corespotlightd may have been demanding exclusive access to particular resources and then getting into the weeds. (This would also explain the escalating stuck process count in top, now that I think about it).

Jan 1, 2025 08:59 AM in response to MgS_2012

The variety of ways this bug can be triggered is a curiosity, and I'd think for Apple's troubleshooters, provides clues. I can reliably trigger it on my Mac by opening a large Pages file, but it crops up randomly too. I've read elsewhere that Spotlight indexing is triggered after each Time Machine backup session. My Mac had to be restarted this morning due to an overnight power failure, and right off the bat the corespotlightd process ran amok. A Time Machine backup was also initiated on restart. A few minutes after Time Machine was done, the process dropped into the background. So, perhaps something to this.


And those of us who now watch Activity Monitor like others watch Netflix have noticed from the graph that when this process goes nuts it can get into a beat, spiking about every five seconds. This can go on for quite a while before it gives up on whatever it is trying to do and settles down. Another clue, perhaps?

MgS_2012 wrote:

So … a couple of updates:

1). Talked to Apple Support yesterday. They took lots of notes, and have passed the issue on to MacOS engineering.

2). It’s been 3 days since I turned off Apple Intelligence on my iMac, and it has returned to normal operation - it took about 24 hours for things to settle down (I was seeing spikes in corespotlightd, but it would come down off them). Since then it’s been behaving itself.

3). Regarding the system CPU usage spikes, I was seeing some spikes of processes like kernel_task when things got into a really hairy state. I suspect this is related to resource allocation issues where corespotlightd may have been demanding exclusive access to particular resources and then getting into the weeds. (This would also explain the escalating stuck process count in top, now that I think about it).


Jan 1, 2025 09:41 PM in response to briantf

I actually ran

nice -n20 bash -c 'while true; do killall -9 corespotlightd 2>/dev/null && sleep 2; done' &

this was actually running in the background consuming battery (at least less than corespotlightd would)

This horrid process not only is causing beachballing but is taking up ~60G in frivolous logs as well 🤬


b@Brians-MacBook-Pro-M4 CoreSpotlight % du -shc *


 28G	NSFileProtectionCompleteUntilFirstUserAuthentication
 
...

 27G	Priority


 56G	total

Jan 3, 2025 08:34 AM in response to MgS_2012

I can't add a great deal to what has been reported apart from that I do not have this issue on a Desktop running on an Intel processor, only on my MacBook Air with an M2 processor. One difference between the MacBook and the Desktop is that Apple intelligence software can't run on an Intel processor.


I did turn Apple intelligence off for an hour, restart it and after an hour the corespotlightd process has become dormant - maybe just a coincidence

Jan 3, 2025 09:31 AM in response to Rollwagen

I've found a couple of ways to reduce the process load, but it's always temporary. Deleting the plist as I first suggested does it for me, but perhaps because this plist is modified by the OS every night, the issue comes back the next day. Possibly any large processor demand is the trigger. For me, the process always falls back into a tolerable range 10-15 minutes after closing the triggering Pages document. Thanks for being our emissary to Apple Support. I know how time consuming this can be. Looking forward to your report!


Rollwagen wrote:

Turning off Apple Intelligence on my M2 MBA macOS 15.2 stopped corespotlightd from hogging the CPU, dropping the process from in excess of 250% of CPU to 0.0 % within 8 hours. However, when I went back into my Pages doc (currently 1.2 MB, stored on iCloud), I continued to experience the spinning rainbow wheel, although less frequently and for less time. I've also experienced hesitation in my other apps (including while typing this post!), but no spinning wheel. I've talked with a member of the Senior Support Team at Apple and have arranged for them to collect data for Engineering to evaluate. That happens this coming Tuesday (my schedule doesn't fit with theirs until then). As much as we all don't like it, it appears it's a problem we'll have to live with for a bit until Engineering can figure out what's happening


Jan 6, 2025 08:57 AM in response to Mitch Stone

After installing macOS 15.2 earlier today, I cannot reproduce the issue. Apart from a single Google Chrome Helper (Renderer) process massively hogging the CPU (which did not return after a force-quit), I've gone from having 27 stuck processes with corespotlightd hogging the CPU to zero stuck processes and corespotlightd very occasionally flashing up in the top-5 of the usage list then vanishing again. No more spinning beachballs. No data entry issues. Time Machine drive reconnected and working. Fingers crossed this has fixed the issue.

Jan 6, 2025 11:19 PM in response to SBML

Good to hear this update helped you, but I am running 15.2 on all of my Macs (3) and still have the issue on one of them.


SBML wrote:

After installing macOS 15.2 earlier today, I cannot reproduce the issue. Apart from a single Google Chrome Helper (Renderer) process massively hogging the CPU (which did not return after a force-quit), I've gone from having 27 stuck processes with corespotlightd hogging the CPU to zero stuck processes and corespotlightd very occasionally flashing up in the top-5 of the usage list then vanishing again. No more spinning beachballs. No data entry issues. Time Machine drive reconnected and working. Fingers crossed this has fixed the issue.


Jan 6, 2025 11:36 PM in response to ericmurphysf

I don't believe this issue is exclusive to Pages, as I have seen it elsewhere, but it seems to be triggered most reliably by opening large documents in this app. Close the document and the process falls back to a normal range in a few minutes, usually. Time Machine is working properly for me, though it could still be implicated in the way you suggest.


Maybe off-topic, but perhaps helpful for your Time Machine issue: TM maintains a library of backup images on the backed up volume, so it might not address an issue with a corrupted TM backup by starting with a new backup drive. You might try forcing TM to verify the existing backup. Control-click on the backup drive in System Settings/General/Time Machine and select "verify" from the popup menu. If it can't be verified you will have the option to delete and backup from scratch. Worth a try.



ericmurphysf wrote:

I've had similar problems with all four of my Macs (a Mac Studio with an M1 Ultra, a MacBook Pro with an M2 Max, an iMac Pro, and a 17-inch 2020 iMac with an 8-core Core i7). On all four systems, I noted sometime around when 15.1.1 came out that corespotlightd would frequently top the list of processes, using anything from 100% CPU all the way to 750%(!) of CPU (on the iMac), causing the fans to spin up on the Intel systems to annoying levels. Updating to 15.2 did not resolve the issue for me, and in fact may have worsened it.

I did notice that corespotlightd calmed down quite a bit simply by closing a large Pages doc (200+ MB), and even more reliably by simply closing Pages on systems where I wasn't actively editing documents (at least, documents that are synced to iCloud). Corespotlightd will still occasionally ramp up to 100+% of CPU, but it won't stay there indefinitely, and most of the time it will be under 50%.

But another more serious issue: I found that after I installed 15.1.1, I could no longer back up the Intel systems via Time Machine. If I tried, one or both situations would arise: (i) a Time Machine backup would be "preparing" for hours or even days; and (ii) attempting such backups would frequently lead to repeated kernel-panics. The only resolution for this latter issue I have found is to disable Time Machine backups entirely. Even starting a backup on a freshly-erased backup drive with no existing Time Machine backups would still lead to the same behavior vis à vis interminable "preparation" of backups and repeated kernel panics.

One thing occurred to me during all of this trouble-shooting: I believe that Time Machine relies on Spotlight to identify files which have been modified since the last backup. I think it may be there is some bug in corespotlightd that aside from consuming vast system resources, also leads to complete (albeit short-lived) system freezes where they don't cause a kernel panic, and also interferes with the proper operation of Time Machine.


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.