gpt4 book ai didi

Linux PID 回收

转载 作者:IT老高 更新时间:2023-10-28 12:30:51 29 4
gpt4 key购买 nike

Linux 中是否有任何关于回收已用 PID 的政策?我的意思是,如果一个 PId 已经被使用过,多久之后会再次使用它?

最佳答案

随着新进程的加入,PID 将增加到与系统相关的限制,然后回绕。在这种环绕发生之前,内核不会重用 PID。

限制(pid 的最大数量)是 /proc/sys/kernel/pid_maxThe manual说:

/proc/sys/kernel/pid_max (since Linux 2.5.34)

This file specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768, results in the same range of PIDs as on earlier kernels

关于Linux PID 回收,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11323410/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com