• On TechRepublic: Five super-secret features in Windows 7
advertisement
mySimon mySimon mySimon Outdoor Gear mySimon Swimwear mySimon Home and Garden
May 16, 2005 12:16 AM PDT

Mac OS X 10.4: Spotlight: Invisible files limitation; Processor usage and performance problems

by CNET staff
  • Font size
  • Print
  • Post a comment

Invisible files functionality lacking, alternatives Spotlight, in its current form, refuses to find invisible files. Although the user can set a criterion to search for both visible and invisible files, or invisible files only (through the Finder-based method of accessing Spotlight), no files are found.

While we haven't yet found a solution to this issue, you can still view invisible files with the aid of an file browser like Kilometre or Invisible Finder.

Places Spotlight does not search Readers should note that there are some limitations to where Spotlight will search. For instance, Spotlight will not search in bundles such as frameworks and application packages.

Processor usage and performance problems For some users, Mac OS X 10.4's Spotlight function consumes inordinate amounts of processor time, resulting in slower overall system performance or seemingly complete systems stalls.

Note that issue is separate from general, expected stalls within Spotlight itself, such as the normal function where Spotlight begins a search during the string typing process, resulting in system unresponsiveness for a few seconds.

Solutions

Giving Spotlight processes less priority via "renice" For some users, giving Spotlight processes less system priority via the "renice" command results in better overall system performance, though performance from Spotlight itself may suffer.

The easiest way to perform this process is to enter the following command in the Terminal:

  • renice -n (new renice setting number) -p (process ID number)

The higher the renice setting number (up to 20), the lower the process priority. The process ID number for various Spotlight operations can be found using Activity Monitor (located in Applications/Utilities). The most implicated process is "mds" -- launch Activity Monitor, and note the process number next to "mds."

  • renice -n 19 -p NNN
(where NNN is the process number received from Activity Monitor. You can also get the process ID for "mds" with the Terminal command "ps -acx | grep mds")

This can also be accomplished with the freeware utility BeNicer. After downloading an launching this application, enter "root" as the user and select the "mds" process, then change its renice setting to a higher number (18 or 19).

Temporarily disabling Spotlight and re-launching Another workaround that has proved successful for some users is simply turning off the Spotlight indexing process for installed volumes then turning it back on.

MacFixIt reader Jeff Hirsch has instructions for doing so in the Terminal:

1) Using the mdutil command-line utility in Terminal, turn off indexing for each of your drives. Example:

  • $ sudo mdutil -i off /Volumes/your_hard_drive_name_1
  • $ sudo mdutil -i off /Volumes/your_hard_drive_name_2

2) Then use mdutil to remove the indexes from each drive

  • $ sudo mdutil -E /Volumes/your_hard_drive_name_1
  • $ sudo mdutil -E /Volumes/your_hard_drive_name_2

3) Physically remove the .Spotlight directories from the root of each drive.

  • $ cd /
  • $ sudo rm -fr .Spotlight-V100

(do the same for your second or third drive)

Make sure to carefully type the "rm" command -- a typo could result in deletion of critical files.

4) Use mdutil again to turn indexing back on for each drive

  • $ sudo mdutil -i on /Volumes/your_hard_drive_name_1
  • $ sudo mdutil -i on /Volumes/your_hard_drive_name_2

5) Spotlight will now re-index all drives and should behave in a normal fashion. (No longer uses 60%-80% of your CPU)

Turning Spotlight off completely Simply killing the mds process or other Spotlight-related processes in Activity Viewer, or using the above disabling process, will not keep Spotlight components from continuing use of excessive system resources for some affected users.

In this case, you can turn Spotlight off completely by editing Mac OS X's hostconfig file, which determines the system components that are loaded at startup.

First, enter the Terminal and use the command:

  • sudo pico /etc/hostconfig

to open the hostconfig file in the "pico" text editor. (For more information about using pico, type the command "man pico" in the Terminal).

Scroll down the hostconfig file and file the line that says "SPOTLIGHT=-YES-" and change it to: "SPOTLIGHT=-NO-" (without quotes).

Exit pico, saving the file, and restart Mac OS X. Spotlight will no longer launch at startup.

To go one step further and remove Spotlight from the menu bar, remove the file "Search.bundle" from the folder /System/Library/CoreServices (move it to the Desktop or another external location) and again restart.

Disabling indexing for certain folders For some users, simply turning off Spotlight indexing for particular problem folders will resolve performance issues.

For instance, the mailbox folders used by some e-mail applications will be re-indexed every time a small change is made, resulting in spikes in processor usage.

MacFixIt reader Johan Solve writes:

"I'm also experiencing high processor usage and much hard disk grinding in Tiger, and I think it's Spotlight-related. It got a bit better when I excluded my Eudora folder from Spotlight indexing, where large mailbox files would get reindexed every time a mailbox was modified by new messages."

Folders can be excluded in the "Spotlight" pane of System Preferences in the "Privacy" tab. Simply click the "+" button in the lower left corner and select the folder to be excluded, or drag the desired folder to the list.

It also appears that folders containing device drivers or related files, such as those for some printers, can cause similar problems.

MacFixIt reader RL Cooley, for instance, writes:

"I Blocked a file -- Hewlett-Packard -- whih stopped all excess processor use This file has Three folders Memories Disk, Webupdate and Plug-ins. It also has the HP un-installer. I find everything works very well so I am not looking further at this time."

Killing the mdimport process MacFixIt reader Lorin Rivers reports that killing the "mdimport" process via the Terminal commands:
  • ps -auxwww | grep mdimport
followed by
  • kill -9 theprocess#returned

reduces processor monopolization by Spotlight.

Future creation/modification dates causing problems, workaround Spotlight apparently has some serious issues dealing with files that have creation dates in the future.

As noted by one reader:

"My initial indexing process after installing Tiger was interrupted by a couple of reboots I had to do while installing third-party apps. This may have left me with a funky index when Spotlight tried to pick up where it had left off. I suggest letting it fully index your drives before rebooting the machine at all.

"A few users in the Discussions over at Apple noticed that they had files on their hard drive with modification dates after the current date. i.e. days/months/weeks into the future. These files may have been causing Spotlight to choke as it tried to make sense of a date that hadn't happened yet."

MacFixIt reader Gabriel Dorado notes a workaround for users who have not yet applied the Mac OS X 10.4 (Tiger) update:

"Spotlight may generate all sorts of problems if the Mac contains files with wrong dates; specially dates in the future. To prevent it, run Norton Disk Doctor 8.02 (which has a feature that corrects these files dates) to fix such wrong dates before installing Tiger. Beware that Norton Disk Doctor is not compatible with Tiger, so it should be run before upgrading to Tiger."

Do not attempt to use Spotlight before other menu items load Scott Rose notes that if you attempt to perform a Spotlight search from the Mac OS X menu bar before other, third-party menu bar items have loaded, it will not function properly.

Scott writes:

"We've noticed that immediately after we log into our account, if we click on the Spotlight icon in the menu bar before all the 3rd-party menu bar icons have finished loading, the Spotlight icon will not be clickable at all (i.e. it does nothing when you click on it). You have to log out/log back in again to make the spotlight icon start working again."

Resources

  • Kilometre
  • Invisible Finder
  • BeNicer
  • More from Late-Breakers
  • Recent posts from MacFixIt
    Address Book: Search not working properly
    iTunes 9.0.3 breaks AirTunes connection for some
    Apple releases Aperture 3.0
    Manage iCal's automatic e-mail generation for invitations
    CNET TV Apple Byte: Apple faces critics
    Weekly Utilities Update: Net Monitor, MiniUsage, TimeMachineEditor, more...
    Odds and Ends: Essential video codec packs for OS X
    Address Book: Unable to add, view contacts
    advertisement

    About MacFixIt

    MacFixIt is CNET's troubleshooting resource for all things Mac. The information here helps you navigate the ins-and-outs of Mac ownership with how-tos, troubleshooting information, news, reviews, and more.

    Add this feed to your online news reader