What happens is that this process is responsible to scanning both the internal and external storage for media, dosage now unfortunately it’s not the best piece of software.
To fix the issue, ampoule depending on your android version you have, go to the apps management section and look for Media Storage. Force Stop it and Clear Data. Reboot.
Now it will re-scan and regenerate the database. (It will have high cpu usage for that period of time (a few minutes depending on how big your storage is)
IF THIS DOESN’T WORK:
It means that one of your media files is corrupted and makes the service retry to rebuild the DB all the time.
What I found that works is an mp3 scan and repair tool for the mac there are some for the PC but that one worked extremely well. (make sure you backup your media before running it)
Please post a comment below if this helped or didn’t help you. Or if you want to say a nice word.
Cheers!

helps alot
No it does not help me. 🙁
have you any idia?
I have solved my problem. The reason was in dictionary, which containing 150 000 mp3 files. I had to delete them all.
Thank you. For the moment, this seems to have done the trick! After much searching, yours looks like a great summary of the best solution to this problem. I’m excited to see what doing an MP3 repair on my library will turn up — maybe the media process got jammed when I tried to play a corrupt mp3.
More details:
I thought either my battery was getting old or my non-OEM charger had damaged my battery. I used Easy Battery Saver to diagnose that android.process.media was taking up a huge constant chunk of my battery life, then was going crazy trying to figure out how to fix that. I read several articles pointing to faulty files (some authors even thought faulty SD card sectors) and I tried the suggestion to create a script (.sh) to try to kill android.process.media from my rooted phone. I already have a new battery and charger coming in the mail from motorola, so I’ll have to see how that changes things too.
Script Code (for the curious):
#!/system/bin/sh
killall -9 android.process.media
killall -9 mediaserver