MacOS – Extreme energy usage by Spotlight

batteryenergymacosspotlight

I recently (two days ago) updated to El Capitan on my work machine (15" MBP, Mid 2015, 2.5 GHz Core i7, 16GB ram, R9 M370X, 500GB SSD) and ever since then, Spotlight has been draining my battery and causing the fans to spin like it's about to take off from my desk. My battery life has gone from about 6-7 projected hours pre-update to only 3 until it's completely drained.

Here's a picture of Activity Monitor:
http://i.imgur.com/BY0MLl7.png
and CPU:

           enter image description here

I initially thought that Spotlight was simply indexing and using high amounts of energy in the process, but 1. it shouldn't be indexing for almost three full days (I don't have very much data stored on the disk at all) 2. the process for indexing is usually called 'mdutil' rather than the actual 'Spotlight' process and 3. Spotlight would usually display a progress bar when it's actually indexing.

I've rebooted multiple times, tried force quitting the Spotlight process (but it just turns back on and uses the same energy) and tried turning mdutil on and off and forcing reindexing (to no effect, most likely because indexing is not the root issue?).

Does anyone know what might be causing this issue?

I updated to El Capitan on my personal Mac way back when it first came out last fall and I never had this issue. Nor do any of the coworkers I've talked to now.

Any help would be greatly appreciated.

Best Answer

It turns out my problem is related to a bug in versions 9.9 and 9.91 of JAMF (enterprise management software) as described here: https://jamfnation.jamfsoftware.com/discussion.html?id=19626
It's unclear as to whether it's directly related to El Capitan or if it affects all versions of OS X.

As far as I know, this bug in JAMF has not been resolved yet but I have found a workaround that alleviates the high CPU usage by spotlight:

For reference, the steps I did to resolve was:

-remove all Spotlight.plist files in /Library/Manged Preferences/
-kill the actual spotlight process (it restarts automatically)

sudo rm -f /Library/Managed\ Preferences/<username>/com.apple.Spotlight.plist
sudo rm -f /Library/Managed\ Preferences/com.apple.Spotlight.plist
sudo killall Spotlight

Note that there may be more Spotlight.plist files than I have explicitly pointed out - delete all of them.

This will not work for you if the problem does not stem from JAMF!

CPU and energy usage should go back to normal at this point. As far as I know, this is still a temporary fix and the problem would come back upon reboot, upon which you would have to reapply this fix.