python function terminated un_Python: 僵尸进程的产生和清除方法

僵尸进程产生的原因¶

在 unix 或 unix-like

的系统中,当一个子进程退出后,它就会变成一个僵尸进程,如果父进程没有通过

wait

系统调用来读取这个子进程的退出状态的话,这个子进程就会一直维持僵尸进程状态。

On Unix and Unix-like computer operating systems, a zombie process

or defunct process is a process that has completed execution (via

the exit system call) but still has an entry in the process table:

it is a process in the "Terminated state". This occurs for child

processes, where the entry is still needed to allow the parent

process to read its child's exit status: once the exit status is

read via the wait system call, the zombie's entry is removed from

the process table and it is said to be "reaped". A child process

always first becomes a zombie before being removed from the resource

table. In most cases, under normal system operation zombies are

immediately waited on by their parent and then reaped by the system

– processes that stay zombies for a long time are generally an error

and cause a resource leak.

并且僵尸进程无法通过 kill 命令来清除。

本文将探讨如何手动制造一个僵尸进程以及清除僵尸进程的办法。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值