MacOS – mdworker process always at 100%, even when not indexing

cpuindexingmacosspotlight

I'm trying to understand why mdworker is always at 100% even when (apparently) not indexing. If I open Spotlight, there's no message telling me that a drive is being indexed. If I run fs_usage -w -f filesys mdworker, there's also no output.

Just to be sure, I've tried stopping and restarting the Spotlight service so it rebuild the db from scratch. I've let it run for about 12 hours but it's still running now at 100%. I've also excluded many folders from indexing.

Any idea what could be the issue? Is there any way to know what the process is actually doing?

Best Answer

Ok it seems to be fixed now. If it can help someone else, here's how to debug the issue:

  • Open the "Activity Monitor" application.
  • Click on the "mdworker" process.
  • Click on the "Inspect" button.
  • In there, click on "Open Files and Ports"
  • Somewhere in this window, check which files are open. Among others, look for the ".mdimporter" files (Spotlight plugins).
  • If one or more mdimporter file always seems to be open, you can disable it by renaming to something else. Open the terminal and run sudo mv /path/to/the/file.mdimporter /path/to/the/file.mdimporter.disabled
  • Then reboot your computer.

In my case, it was the file /Applications/Britannica 13.0/Ultimate Reference Suite.app/Contents/Library/Spotlight/BritannicaBookmark.mdimporter that was constantly open. After renaming it, things are back to normal.