I have a couple of processes that appear with Safari, I think, that periodically become “Not Responding”. When this is so, Safari 8.0.2 running in OS X 10.10.1 slows to a crawl. It recovers if I force quit these two processes: callservicesd and identityservicesd.
My problem is that “Process Not Responding” is not a process state so I’m not sure who pops that in the Activity Monitor. Is there any way (not using the Activity Monitor) to detect these and kill them?
Process not responding, is probably a translation of the more geeky ‘zombie’ state.
You can reckognize those from a terminal window, with ps -Al, since it seems the services/processes are owned by the current user. (sudo ps -Al otherwise). Be sure to have a wide enough terminal window, so the process name is visible. If you execute this next time it hangs, you may have a look at the state under the “S” column, (I am pretty sure you’ll see a “z there).”
You should also be able to kill them with kill -9 “pid”, it should also be easy to write a shell script that kills the services and thereby forces them to be restarted. -Naturally you’ll get two lines back that contains the service name, and you will ignore the one containing grep.
It is all in the definition of what constitutes a user procssess, they are still owned by the current user, at least the identityservicesd is owned by the current user, and is said to be run in a user context, but it is much more like an agent of course, which is the closest synonym to a service I can think of at the moment.
The importent thing here is that the operating system doesn’t differ much between daemons, agents, programs etc, but treats them all as processes, except for the init process (pid 0), which is started differently.
I found a couple of shellscripts I use for killing processes interactively, which may, or may not help. (The zap script gets a superflous process at my disk, but I don’t care to figure out why at the moment, since it is done interactively. Most probably, because the tools are upgraded since I wrote it.
Those scripts should really be put into your ~/bin folder for best results.
I hope this helps, at least as a starting point.
Pick, is called by zap, and lets you choose wheter to choose a line, skip it, or quit altogether, the input is taken from stdin.
Right. The docs for the Cocoa class NSRunningApplication say: “NSRunningApplication is a class to manipulate and provide information for a single instance of an application. Only user applications are tracked”.
Now I can see both the processes Adam named in Activity Monitor, but when I run this script:
use framework "Foundation"
use framework "AppKit"
set theProcesses to (current application's NSWorkspace's sharedWorkspace()'s runningApplications()'s valueForKey:"localizedName") as list
neither of them is listed, although processes like universalaccessd, sharingd, EscrowSecurityAlert and rcd are all listed.