Tuesday, 16 January 2018

MacOS Processes and Daemons

Every now and then, a processes in MacOS goes bad. Slowed down performance and whining fans can be symptoms of an overactive process.

To see which process has gone bad, one can
  1. Launch Applications > Utilities > Activity Monitor.
  2. Click on CPU (if this tab isn't already active).
  3. Click on % CPU to sort by most active process. Click once or twice to get the highest numbers on top.
Some of the processes, like photoanalysisd will simply take a lot of time. The best thing (and sometimes only thing) one can do, is to sit them out. Let the Mac run for a few minutes, hours or more, to let them do whatever they do. In other cases, a restart will fix the problem.

Here are some processes and some short description of what they do in High Sierra, MacOS 10.13. I found no easy to use official page for all this. The following information comes mostly from different forums, so take it with a pinch of salt.
  • amfid - Apple Mobile File Integrity Daemon. Checks the integrity of files running on the system.
  • cloudd - syncs iCloud data. Uses nsurlsessionid.
  • helpd - some help daemon. Indexes help files. May create caches that could go corrupt. If it goes bad, try to delete cache files (see below), and prepare to wait for it to rebuild the cache. It wants to connect to the internet for updates.
  • hidd - Human Interface Device Daemon. Linked to mouse, trackpad, keyboard, and so on.
  • ksfetch - part of Google Chrome's update
  • launchd - launches other processes.
  • mds - ‘metadata server worker' or in other words: Spotlight indexing.
  • mds_stores - Spotlight indexing.
  • mdworker - Spotlight indexing.
  • nsurlsessiond - a process that is used by iCloud to sync. It handles background internet connections.
  • photoanalysisd - analyses photos in Photos to create categories like “flowers” or “cars”. You access them by searching in Photos.
  • secd - relates to runtime security policies for processes. Linked to Keychain.
  • sysmond - monitors system activity in background.
Some information can be found for some of the processes using MacOS' Unix shell:
  1. Launch Applications > Utilities > Terminal.
  2. Type man process_name, where "process_name" is the name of the process you want information about.
  3. Type q to get out of the information screen. 
The cache files of helpd contain help information like the one you find in the Finder menu Help. If they go corrupt and cause helpd to go in overdrive, one may try to delete them. Just keep in mind that deleting this kind of information could cause other problems. If you want to be brave, these are the steps to delete the files:

  1. Go to Finder.
  2. Hold down the alt button and click on the menu Go > Library. (The option Library is only visible if you hold down the alt button.)
  3. Go to Library/Caches/com.apple.helpd/
  4. Drag anything you think could be wrong to the Trash.
  5. Wait for helpd to rebuild the cache. This may take some time.
Other more generic remedies against bad performance are: Close unused open applications to free up CPU and memory. Restart. If nothing else helps: delete the current account and create a new one to start from scratch.