1831349 Members
2785 Online
110024 Solutions
New Discussion

PID allocation

 
SOLVED
Go to solution
John Oberlander
Frequent Advisor

PID allocation

Im not finding this question on the forums anywhere so im going to ask. On HP-UX 11iv1 how are pids allocated, how high to they go and when are they reused? Any docs on this would be appreciated.

Thanks,
John
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: PID allocation

Hi John:

The maxiumum value for a PID (MAXPID) is defined in '/usr/include/sys/param.h'.

Regards!

...JRF...
John Oberlander
Frequent Advisor

Re: PID allocation

Ok thanks! Thats a start, ill take a look at that file. But how do i get to pid's of 20000 when theres never over 5000 or so processess running? At what point to they get recirculated? Does the system use all the pids from 1-MAXPID then recycle through the free ones?
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: PID allocation

Actually the best way is to ask the kernel itself:

echo "effective_maxpid/D" | adb -k /stand/vmunix /dev/kmem

Typically the value is 30,000 --- which has been the UNIX standard for decades although some UNIX flavors go much higher. Once the effective_maxpid is reached, the pid's are recycled starting with the lowest free pid (although a few low values are reserved and thus are skipped over).
If it ain't broke, I can fix that.
John Oberlander
Frequent Advisor

Re: PID allocation

Ah, i knew i never seen pids in the 8M's. My kernel is at 30K also. We're building a process tracking system, im pretty sure this will be enough info.

Thanks much!
John
John Oberlander
Frequent Advisor

Re: PID allocation

Closed