0

A very elementary question: I observed that the PID given to new process keeps increasing. As of now when I typed ps the pid of ps is given as 48564. (when i do ps again it gets a +1 value)

The limit given in the file /proc/sys/kernel/pid_max is 65536.

So what would happen if I reach this limit. Are the PIDs of terminated processes reused ?

WYSIWYG
  • 494
  • 6
  • 23
  • [This](http://unix.stackexchange.com/questions/26677/will-process-ids-be-recycled-what-if-you-reach-the-maximal-id) and [this](http://superuser.com/questions/135007/how-are-pids-generated) are all you need. Strange you didn't find them upon Google search. – axiom Mar 05 '14 at 13:20
  • yep.. my bad.. i should have looked more thoroughly.. please close it. – WYSIWYG Mar 05 '14 at 13:23

1 Answers1

7

Yes of course they are reused. Some systems run for years, and every one of those 65K PIDs will be recycled thousands of times, except for the first few which are "special."

John Zwinck
  • 239,568
  • 38
  • 324
  • 436