mds (spotlight) taking up 128M of REAL memory

mainstreetmark

macrumors 68020
Original poster
May 7, 2003
2,229
293
Saint Augustine, FL
According to Activity Monitor, the accursed "mds" process is taking up 127.32M of Real Memory, more than kernel_task at 114MB.

I rarely use Spotlight, but it and Dashboard have managed to use up most of my remaining 1GB of RAM. Very disappointing so far.

Dashboard widgets take up an average of about 200MB of Virtual Memory, but I'm hoping those numbers are skewed due to some creative threading.

I wish you could easily turn these guys on and off.

On a related topic, my VM Size is at 9.91 GB. I should logically have at least that much free on my disk, correct?
 

mainstreetmark

macrumors 68020
Original poster
May 7, 2003
2,229
293
Saint Augustine, FL
No replies here?

I'm this close to disabling spotlight entirely. It's usefulness to me is far less than having it suck up so much resources.

It's running right now, presumably because I recently saved like 3 files.

--

Edit: It doesn't even care that I'm now on battery. I opened the lid, and it decided it needed to re-index something at 40% cpu
 

jaseone

macrumors 65816
Nov 7, 2004
1,245
57
Houston, USA
My mds is only using up 14.76MB of Real and 48.68MB of virtual Memory right now and that is after it just finished re-indexing my external hardrive.

Try deleting the /.Spotlight-V100 directory on each of your volumes from the Terminal and make sure you don't do anything to interrupt the re-indexing afterwards.

I think I installed a software update and rebooted in the middle of my external drive being indexed first time around and then everytime I plugged it in it would not mount for ages, so I tried deleting the Spotlight index file and having it re-indexed and now it mounts almost instantly.
 

mainstreetmark

macrumors 68020
Original poster
May 7, 2003
2,229
293
Saint Augustine, FL
I just found something similar over on Macintouch, reprinted here for googleability. I'll let you know if it works.

May 11, 2005

Spotlight

Jeff Hirsch
I can confirm that there are issues with Spotlight hogging the CPU under certain circumstances. In particular, the mds (metadata) process and mdimport process can eat up a huge chunk of available CPU and RAM. Upwards of 80% at times, causing a very noticeable slowdown on even the fastest of machines.

A quick search for "mds cpu" in the 10.4 Discussions over at Apple shows that a number of users are dealing with the same issue. Here is what I did to fix the problem and some thoughts on possible causes. First the fix:

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) BE CAREFUL WITH THAT RM COMMAND! One typo could ruin your day.

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)

Finally a couple of quick thoughts on possible causes:

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.
I did a quick search for files modified "after" today and found a handful of them on my hard drive. (A few were dated 2031!) I used the touch command in Terminal to give these proper dates. If you have a lot of these files, you might want to create and Automator script to touch them all for you.

Hope this saves some of you a headache or two.
 

mainstreetmark

macrumors 68020
Original poster
May 7, 2003
2,229
293
Saint Augustine, FL
Ok, after following the above directions, things seem normal(er).

I had about 250 files from the future (pics from a digital camera), which I adjusted to "today".

I turned off spotlight, removed the database, and turned it on. It started indexing so I went to the bars and then I guess passed out or something.

But, here I am today, and CPU load is low and mds's Real Memory is hovering around 25Megs (63 Megs virtual)

What's even cooler is that it's now actually fast and, I suppose, useable! Maybe I should give it another chance. Odds are, my initial index was just messed up. I recall it taking most of the day to index the first time around, and I only got a 75G drive.
 

mainstreetmark

macrumors 68020
Original poster
May 7, 2003
2,229
293
Saint Augustine, FL
screw it. I turned off Spotlight. I have a friggin Gigabyte of memory, and Spotlight feels like it needs a full eighth of that at all times.

I'm sure in the next 20 minutes, I'll have a need for Spotlight, too. :(
 

Kermie004

macrumors newbie
Jun 3, 2009
1
0
Firefox memory leak

I was having this issue as well, but after watching it I noticed that it only happened on my laptop, not my desktop, and only when Firefox was running.

The mds process was running at around 250mb Real Memory and had never before shown up in the top 5 processes for the life of my laptop.

I re-downloaded and re-installed Firefox. Now the mds process runs at only around 10-12mb consistently.
 

TheSpaz

macrumors 604
Jun 20, 2005
7,032
1
Only 1GB of RAM? ;) You should really think about upgrading your RAM at some point. 1GB isn't enough these days. I have 5GB.
 

borcanm

macrumors regular
Nov 4, 2008
177
0
I have had that too. Try reseting your PRAM (Thats Alt+Command+P+R while booting just before the chime, and hold you hear the second boot chime).

Or do the one where you take out the power cord, the battery and hold power down for 5 seconds.
 

ppc750fx

macrumors 65816
Aug 20, 2008
1,309
1
I have had that too. Try reseting your PRAM (Thats Alt+Command+P+R while booting just before the chime, and hold you hear the second boot chime).

Or do the one where you take out the power cord, the battery and hold power down for 5 seconds.
This will do absolutely nothing to Spotlight or its various components.

To the OP: Is there a reason you're obsessing over Spotlight's RAM usage? It seems to me like you're getting a little too bent out of shape over the exact numbers... You should only really worry about RAM usage if 1) you experience substantial performance degradation 2) you're doing something that requires huge amounts of non-paged memory.

Edit 2: Oh. Ahem. Four years. Wow.
 

ImNoSuperMan

macrumors 65816
Dec 1, 2005
1,215
30
Strange. Mine is showing just 5MB real and bout 50MB virtual. And I have 320GB HD in this MB. I m sure there is something wrong here.
 

macrumorino

macrumors regular
Dec 25, 2007
102
0
Eight years later...

mds... 0.0 % cpu, and... 457 MB of RAM being hogged for a set of files that has remained almost completely stable for years.

:apple::apple::apple: mds... sloppily managing your resources since anyone can remember. :apple::apple::apple: