bash 即使在杀死所有 java 进程之后 java <defunct> 仍然存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20420054/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java <defunct> still present even after killing all java processes
提问by user2496751
Executed below command to kill java process on linux system.
执行下面的命令来杀死 linux 系统上的 java 进程。
ps -ef | grep java | grep -v grep | awk '{print $2}'| xargs kill -9
ps -ef | grep java | grep -v grep | awk '{print $2}'| xargs kill -9
After this when I checked for running java processes, I could find "[java] " process still running.
在此之后,当我检查正在运行的 java 进程时,我可以发现“[java]”进程仍在运行。
How to kill these defunct processes ?
如何杀死这些失效的进程?
回答by Adrian Pronk
Zombie (defunct) processes are dead. All processes on unix hang around after they die until their parent process requests their return status. Most of the time, that happens instantly so you never see that the process is a zombie. But if the parent process is hung or stopped, it can't release its dead child processes so they hang around as zombies.
僵尸(已失效)进程已死。unix 上的所有进程在它们死后都会挂起,直到它们的父进程请求它们的返回状态。大多数情况下,这会立即发生,因此您永远不会看到该过程是僵尸。但是如果父进程挂起或停止,它就不能释放它死掉的子进程,所以它们像僵尸一样徘徊。
回答by Srinivas Gedela
Even though defunct processes are killed with kill -9 command, session handles will remain with terminal window. If we logout and login back that will clear all session handles
即使不存在的进程被 kill -9 命令杀死,会话句柄仍将保留在终端窗口中。如果我们注销并重新登录,将清除所有会话句柄