{"id":305,"date":"2005-11-01T01:12:34","date_gmt":"2005-11-01T09:12:34","guid":{"rendered":"http:\/\/www.wiredatom.com\/blog\/?p=305"},"modified":"2005-12-23T17:44:19","modified_gmt":"2005-12-24T01:44:19","slug":"osx-spotlight-hogs-cpu","status":"publish","type":"post","link":"https:\/\/www.wiredatom.com\/blog\/2005\/11\/01\/osx-spotlight-hogs-cpu\/","title":{"rendered":"OSX Spotlight Hogs CPU"},"content":{"rendered":"<p>For the past couple of weeks, the fan on my PowerBook would just start spinning like crazy out of the blue. Checking the CPU usage didns&#8217;t really yield any satisfactory results. But I finally found the culprit &#8212; <a href=\"http:\/\/www.apple.com\/macosx\/features\/spotlight\/\" target=\"_blank\">Spotlight<\/a>. <\/p>\n<p>According to <a href=\"http:\/\/venueserver.rcc.ryerson.ca\/index.php?option=com_content&#038;task=view&#038;id=31&#038;Itemid=40\" target=\"_blank\">Many Ayromlou<\/a>, sometimes Spotlight does hog the CPU, most likely when it&#8217;s trying to index corrupted metadata. So I applied the fix suggested by the site:<\/p>\n<blockquote><p>\n1) Using the mdutil command-line utility in Terminal, turn off indexing for each of your drives. example:<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">$ sudo mdutil -i off \/Volumes\/&lt;i&gt;your_hard_drive_name&lt;\/i&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>2) Then use mdutil to remove the indexes from each drive<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">$ sudo mdutil -E \/Volumes\/&lt;i&gt;your_hard_drive_name&lt;\/i&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>3) Physically remove the .Spotlight directories from the root of each drive.<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"text codecolorer\">$ cd \/<br \/>\n$ sudo rm -fr .Spotlight-V100<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><i>(do the same for your second or third drive) <strong>BE CAREFUL WITH THAT RM COMMAND!<\/strong> One typo could ruin your day.<\/i><\/p>\n<p>4) Use mdutil again to turn indexing back on for each drive<\/p>\n<div class=\"codecolorer-container text railscasts\" style=\"overflow:auto;white-space:nowrap;width:680px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">$ sudo mdutil -i on \/Volumes\/&lt;i&gt;your_hard_drive_name&lt;\/i&gt;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>5) Spotlight will now re-index all drives and should behave in a normal fashion. (No longer uses 60%-80% of your CPU)<\/p><\/blockquote>\n<p>As Spotlight tried to re-index my entire hard drive again, I snapped this shot&#8230;<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"\/images\/spotlight_indexing.png\" width=\"349\" height=\"245\" class=\"centered\" alt=\"Spotlight indexing\" \/><\/p>\n<p>Even though it estimated 10+ hours to index all of 23GB of files on my hard drive, the actual time it took to index everything was more like 2 hours &#8212; a far more acceptable time.<\/p>\n<p>All this was done while I was trying to feed Bryan, change his diaper, check my email, read the online forums from SCAD eLearning, browse through the news and send a homework-related mass email.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For the past couple of weeks, the fan on my PowerBook would just start spinning like crazy out of the blue. Checking the CPU usage didns&#8217;t really yield any satisfactory results. But I finally found the culprit &#8212; Spotlight. According to Many Ayromlou, sometimes Spotlight does hog the CPU, most likely when it&#8217;s trying to &hellip; <a href=\"https:\/\/www.wiredatom.com\/blog\/2005\/11\/01\/osx-spotlight-hogs-cpu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;OSX Spotlight Hogs CPU&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[10,3,4],"tags":[],"class_list":["post-305","post","type-post","status-publish","format-standard","hentry","category-geek-stuff","category-mac-osx","category-tips-tricks"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p54IqZ-4V","_links":{"self":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredatom.com\/blog\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}