What is the maximum and minimum value for a PID (Process ID) on Linux and Solaris?

link|improve this question
feedback

migrated from stackoverflow.com Jun 10 '11 at 14:36

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 5 down vote accepted

http://www.alexxoid.com/blog/linux/getting-the-max-pid-value-for-linux-process.html

To get the max PID value that can be assigned to Linux process, run the following command:

# cat /proc/sys/kernel/pid_max

On my server:

Linux lenny 2.6.32.8-grsec-2.1.14-modsign-xeon-64 #2 SMP Sat Mar 13 00:42:43 PST 2010 x86_64 GNU/Linux

The result is:

32768
link|improve this answer
feedback

You've had, and accepted, a Linux answer. On Solaris, the maximum value of a process ID is a kernel tunable parameter — pidmax in /etc/system — that defaults to 30,000 and that can be set anywhere between 266 and 999,999. Note that this is not max_nprocs, which is a kernel tunable parameter with a subtly different function.

link|improve this answer
feedback

The minimum is 1 and usually the maximum is 2^15

link|improve this answer
... except on Solaris, as in the question, where it isn't. – JdeBP Jun 10 '11 at 14:45
The minimum PID is actually 0, i.e. the kernel which isn't a process really ... – jlliagre Jun 10 '11 at 15:05
do the kernel get a PID? – gtirloni Jun 13 '11 at 9:58
It doesn't need one but is given pid 0. Under Linux, I guess it is only shown as a PPID but under Solaris, there is definitely a /proc/0 entry and ps reports process 0 as "sched". – jlliagre Jun 14 '11 at 5:32
feedback

Your Answer

 
or
required, but never shown