在OS X类系统上ps(1)的输出中,括号中列出的进程是什么意思,我该如何杀死它们?

username@yosemite ~ % ps wwwaux | grep java username 48111 0.0 0.0 0 0 ?? ?E 11:54AM 0:00.00 (java) username 91673 0.0 0.0 2432772 508 s006 R+ 3:19PM 0:00.00 grep java username 90809 0.0 0.0 0 0 ?? ?E 12:47PM 0:00.00 (java) 

每隔一段时间我都会得到一个像这样挂起的JVM。 (java)进程列表是什么意思? 我怎么杀他们? kill -9 48111不做任何事情,AFAICT列表呆在那里,直到我重新启动。

如有疑问,请参阅手册页:)

 $ man ps /parenth When printing using the command keyword, a process that has exited and has a parent that has not yet waited for the process (in other words, a zombie) is listed as ``<defunct>'', and a process which is blocked while trying to exit is listed as ``<exiting>''. If the arguments cannot be located (usually because it has not been set, as is the case of system processes and/or kernel threads) the command name is printed within square brackets. The process can change the arguments shown with setproctitle(3). Otherwise, ps makes an educated guess as to the file name and arguments given when the process was created by examining memory or the swap area. The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information. The ucomm (accounting) keyword can, however, be depended on. If the arguments are unavailable or do not agree with the ucomm keyword, the value for the ucomm keyword is appended to the arguments in parentheses. 

另外:

 KEYWORDS The following is a complete list of the available keywords and their meanings. Several of them have aliases (keywords which are synonyms). ... ucomm name to be used for accounting 

看起来这些是僵尸进程,而不是仅仅返回<defunct>作为进程名称,而是返回存储在某种会计logging中的内容。

至于杀死这些进程,重启可能是最好的select。 由于他们失去了原来的PPID并成为PPID 1(已启动)的子女。 您可以尝试发送一个HUP信号来启动,但不要试图发送SIGKILL或SIGTERM信号,否则会导致系统崩溃。

你可以使用ps -efvalidation僵尸进程的PPID。

注意 :有几个僵尸进程不应该伤害任何东西。 该进程实际上并没有运行,它已被终止,并没有使用任何系统资源,除了在进程表中的条目。