* This controls the default maximum pid allocated to a process If you are referring to the maximum value that can be achievedĪccording to the definitions in the Kernel: What is the maximum value of the Process ID? cat /proc/sys/kernel/pid_max The only thing you could do to get a new one is have your code fork a new process and terminate the old one. It gets assigned as a sequential number by the kernel at the time the process starts and that is it's identifier from that time on. (PID_MAX_LIMIT, approximately 4 million).Īnd no, you cannot change the PID of a running process. On 64-bit systems, pid_max can be set to any value up to 2^22 On 32-bit platfroms, 32768 is the maximum value for Theĭefault value for this file, 32768, results in the same range of PIDs as (i.e., the value in this file is one greater than the maximum PID). This file (new in Linux 2.5) specifies the value at which PIDs wrap around It seems to be normative practice on most 64 bit systems to set this value to the same value as found on 32 bit systems, but this is by convention rather than a requirement.įrom man 5 proc: /proc/sys/kernel/pid_max This value can also be written using the same file, however the value can only be extended up to a theoretical maximum of 32768 for 32 bit systems or 4194304 for 64 bit: $ echo 32768 > /proc/sys/kernel/pid_max On Linux, you can find the maximum PID value for your system with this: $ cat /proc/sys/kernel/pid_max
0 Comments
Leave a Reply. |