[Samsung Galaxy Nexus] rowansmith:
I was having the same problem and the phone was burning a hole in my pocket.

I found that the problem only seemed to occur on a reboot with android.process.media consuming 96% of the CPU for approximately 40minutes.

I attempted to add a .nomedia file to every single directory on the root of my internal SDCARD. - This made no difference.

I discovered that if I killed the process via the terminal it was eventually restarted by zygote and the same issue occured.

I found the only way to stop this from occuring was to Freeze the "Media Storage" app using Titanium Backup. But (not surprisingly) other things did not work - eg being able to capture a screenshot.

I also discovered that if I went into Titanium Backup and issued a "Clear Cached Data" for the Media Storage app, this resulted in the process ceasing it's CPU consumption - useful - but hardly a silver bullet and an annoying step to take after every reboot. (Additionally I do not know if the scan process might of kicked off automatically at some later stage anyway).

Interestingly I discovered that the phone did not overheat when it was plugged into a power supply - completely unrelated but none the less I found this interesting cause I always thought it was the CPU causing the overheating - when in actual fact it was the battery being emptied - unrelated to the issue at hand but none the less a nice tangent :)

Now this is what I discovered:

I have an application called NZ Topo Maps, it creates a absolutely massive directory structure to download all the tiles of NZ and cache them locally. Each directory can have many sub directories which in turns has many more and can have many many files in each.

So I deleted the entire tilecache. The result - after a reboot android.process.media consumed 5seconds of CPU.

Not convinced I browsed some maps and "cached" ~64MB of tiles - rebooted - 2:33mins of CPU time consumed... hmmmm.

So I cached ~128mb of tiles - 7:44mins of CPU time consumed after a reboot - diffidently onto something here....

Of interest - every single directory which the NZ Topo Maps program creates has a ".nomedia" included and all of the files are labelled with a *.jpg_ suffix.

So I decided to do some more research - Under the structure I had 425 sub-directories and 10615 files that ended with the suffix .jpg_

Out of curiosity I deleted all the files (including the .nomedia) and left the directory structure completely intact.

After a reboot the media process consumed 32sec of CPU time.

For the final test I deleted the directory structure:

CPU consumed: SIX seconds!!!!

Solved: Why android.process.media is consuming so much battery.... for me atleast.

So in conclusion it seems that:

1) The .nomedia directive applies only to the current directory - android.process.media will still recurse into sub directories

2) The .nomedia does not make any difference to the time it takes media to process the contents of a directory - eg - it was still doing "something" with the files in the directory.

3) The naming of files .jpg_ does not make any difference either, the process will still look at them - not sure if it is supposed to or not.

Where to from here - I would really like to find the source for this process and have a look at it's logic, but right now I just don't understand the android internals enough to be able to determine where the source is located in the source tree! I have posted another thread about this - http://xdaforums.com/showthread.php?p=34326153#post34326153 hopefully someone will give me an answer because this situation is less than ideal.

Hopefully this helps someone else and sends them in the right direction?

Rowan