Skip to main content
Added the power of 2 representations of pid_max limits for both 32 and 64 bits systems
Source Link

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 (2^15) for 32 bit systems or 4194304 (2^22) for 64 bit:

$ echo 32768 > /proc/sys/kernel/pid_max 

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.

From man 5 proc:

/proc/sys/kernel/pid_max

This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

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.

From man 5 proc:

/proc/sys/kernel/pid_max

This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 (2^15) for 32 bit systems or 4194304 (2^22) for 64 bit:

$ echo 32768 > /proc/sys/kernel/pid_max 

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.

From man 5 proc:

/proc/sys/kernel/pid_max

This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

Minor formatting of man page quote
Source Link
AdminBee
  • 23.6k
  • 25
  • 56
  • 77

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

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.

From man 5 proc:

/proc/sys/kernel/pid_max 

/proc/sys/kernel/pid_max

This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).

 This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). 

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

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.

From man 5 proc:

/proc/sys/kernel/pid_max 
 This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). 

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

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.

From man 5 proc:

/proc/sys/kernel/pid_max

This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

added 17 characters in body
Source Link
Caleb
  • 72k
  • 19
  • 203
  • 234

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

It seems to be normative practice on most 64 bit systems to set this value to the maximumsame value as found on 32 bit valuesystems, but this is by convention rather than a requirement.

From man 5 proc:

/proc/sys/kernel/pid_max 
 This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). 

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

It seems to be normative practice on most 64 bit systems to set this value to the maximum 32 bit value, but this is by convention rather than a requirement.

From man 5 proc:

/proc/sys/kernel/pid_max 
 This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). 

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

On Linux, you can find the maximum PID value for your system with this:

$ cat /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 

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.

From man 5 proc:

/proc/sys/kernel/pid_max 
 This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million). 

And no, you cannot change the PID of a running process. 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. The only thing you could do to get a new one is have your code fork a new process and terminate the old one.

added 160 characters in body
Source Link
Caleb
  • 72k
  • 19
  • 203
  • 234
Loading
clarify confusing langage
Source Link
Caleb
  • 72k
  • 19
  • 203
  • 234
Loading
added 520 characters in body
Source Link
Caleb
  • 72k
  • 19
  • 203
  • 234
Loading
this answer is specific to Linux (which is undoubtedly what the asker had in mind); replaced “run exec” (which wasn't even grammatical) by “fork” (which is perhaps obscure but technically correct)
Source Link
Loading
Source Link
Caleb
  • 72k
  • 19
  • 203
  • 234
Loading