Contribute
Register

Idling for 10 minutes causes Sierra to lag/freeze for a couple of minutes

Joined
Jun 13, 2013
Messages
27
Motherboard
Gigabyte Z390 Designare
CPU
i9-9900K
Graphics
RX 580
Mac
Mac Pro
There is a simple fix to the lags/hangs after 5 minutes of idle. Simply disable the offending mediaanalysisd which is part of Apple's video processing framework. Photos will just work fine, you'll only miss some metadata on videos, but it's not a big deal.
I'm guessing this will likely break the analysis aspects of the Photos app, such as facial/object recognition?
 
Joined
Dec 27, 2014
Messages
37
Motherboard
Asus Z97M
CPU
Intel i7-4790K
Graphics
nVidia GTX 970
Mac
iMac, MacBook, Mac mini
Mobile Phone
iOS
I'm guessing this will likely break the analysis aspects of the Photos app, such as facial/object recognition?
I am not really sure, I didn't really use this feature much. I think photoanalysisd does the facial/object recognition stuff, mediaanalysisd seems to process videos.
 
Joined
Dec 27, 2014
Messages
37
Motherboard
Asus Z97M
CPU
Intel i7-4790K
Graphics
nVidia GTX 970
Mac
iMac, MacBook, Mac mini
Mobile Phone
iOS
This sounds promising but I'm getting caught up:

JaredsiMac:~ jaredminiman$ sudo rm /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist
override rw-r--r-- root/wheel restricted,compressed for /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist? y
rm: /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist: Operation not permitted

A little help here, please! I assume SIP is getting in my way?
You can disable mediaanalysisd by issuing a launchctl unload -w command on it. This will stop the process and disable it for the future. This way you don't have to delete the plist file, which may be prohibited by the SIP settings. This is a nicer way to deal with the problem anyway.
 
Joined
May 11, 2013
Messages
199
Motherboard
GA-Z170x-UD5-TH
CPU
i7-6700k
Graphics
MSI GeForce GTX 1080Ti Gaming X
Mac
MacBook Pro
Mobile Phone
iOS
You can disable mediaanalysisd by issuing a launchctl unload -w command on it. This will stop the process and disable it for the future. This way you don't have to delete the plist file, which may be prohibited by the SIP settings. This is a nicer way to deal with the problem anyway.
I get this when i try to do that:
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist
/System/Library/LaunchAgents/com.apple.mediaanalysisd.plist: Could not find specified service

What should I do?
 
Joined
Jun 13, 2013
Messages
27
Motherboard
Gigabyte Z390 Designare
CPU
i9-9900K
Graphics
RX 580
Mac
Mac Pro
I am not really sure, I didn't really use this feature much. I think photoanalysisd does the facial/object recognition stuff, mediaanalysisd seems to process videos.
Looks like you are correct. After disabling mediaanalysisd and re-enabling iCloud Photos, facial/image recognition appears to be functioning normally for me. Really can't thank you enough for this fix! This was my only issue on an otherwise flawless system.
 
Last edited:
Joined
Feb 12, 2012
Messages
17
Motherboard
ASUS P8H67
CPU
i5 2500K
Graphics
GTX 1060 6GB
Mac
MacBook Pro
Mobile Phone
iOS
I get this when i try to do that:
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist
/System/Library/LaunchAgents/com.apple.mediaanalysisd.plist: Could not find specified service

What should I do?
Same issue here, cant for the life of me find that mediaanalysis deamon.

Edit: guest account seems to be fine, so it must be a software issue? I do use iCloud photo and have a quite large library but cant find that medianalysis deamon. Would anyone be able to point me in the right direction?
 
Last edited:
Joined
Feb 12, 2012
Messages
17
Motherboard
ASUS P8H67
CPU
i5 2500K
Graphics
GTX 1060 6GB
Mac
MacBook Pro
Mobile Phone
iOS
I get this when i try to do that:
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist
/System/Library/LaunchAgents/com.apple.mediaanalysisd.plist: Could not find specified service

What should I do?
Found a fix, just locate that fine in the System Library folder and delete it (I backed it up first, and then deleted it just in case). But this has totally fixed my issues :) YAY!
 
Joined
Nov 29, 2012
Messages
118
Motherboard
Gigabyte Z490M Gaming X
CPU
i7-10700
Graphics
RX 580
There is a simple fix to the lags/hangs after 5 minutes of idle. Simply disable the offending mediaanalysisd which is part of Apple's video processing framework. Photos will just work fine, you'll only miss some metadata on videos, but it's not a big deal.

Enter the following command in Terminal:

sudo rm /System/Library/LaunchAgents/com.apple.mediaanalysisd.plist

and then log out/in. Problem solved. :)

If you prefer more elegant solutions, you can use the launchctl unload command instead of the simple delete. For a comlete peace of mind, you can also disable photoanalysisd.
I can't thank you enough. I disabled SIP, backed up and removed this file, reenabled SIP, and now my system is hang-free. After months of wrestling with this, my Hackintosh is finally back to normal. You rock!
 
Top