Linux PID回收 [英] Linux PID recycling

查看:142
本文介绍了Linux PID回收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux中是否有关于回收使用过的PID的政策?我的意思是,如果使用了PId,将在多久后再次使用它?

Is there any policy in Linux as to the recycling of used PIDs ? I mean, if a PId has been used, how much later will it be used again ?

推荐答案

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

As new processes fork in, PIDs will increase to a system-dependent limit and then wrap around. The kernel will not reuse a PID before this wrap-around happens.

限制(最大pids)为/proc/sys/kernel/pid_max. 手册说:

The limit (maximum number of pids) is /proc/sys/kernel/pid_max. The manual says:

/proc/sys/kernel/pid_max(从Linux 2.5.34开始)

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

此文件指定 PID环绕(即, 此文件中的值比最大PID大1).默认值 该文件的值32768导致PID范围与打开时相同 较早的内核

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回收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆