|
#1
| ||||
| ||||
| What is your current highest PID? Another frivolous but potentially interesting thread: your current highest process-ID. I got the idea for this one day when I was amazed to see very high PIDs on my iBook, which I restart rather often. I can only imagine those with Mac Pros or XServes who don't reboot for months at a time. Quick code to return the highest PID (run in Terminal.app): Code: ps a | grep ps | grep -v grep | awk '{print $1}'
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 Last edited by michaelsanford; May 29th, 2008 at 04:45 PM. Reason: Added `grep -v grep` which I *always* forget. |
|
#2
| ||||
| ||||
| Wow, what an equally neat and frivolous idea Mike; mine's 37198.
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 |
|
#3
| ||||
| ||||
| 1511. |
|
#4
| ||||
| ||||
| 37198? But Mac OS X unlike BSD recycles the PIDs back from 0 once it reaches 31999... Ok I've got a lousy uptime of 6 days as I had to reboot for reloading newer Fusion kexts, so highest PID is only 2526. With dashboard off... |
|
#5
| ||||
| ||||
| It recycles pids? But I've had pids of 80000 and higher, I'm *fairly* certain, at least. 1007, anyway (rebooted after Mark/Space update, which REALLY should only require logout).
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 |
|
#6
| ||||
| ||||
| PIDs wrap somewhere near the 30k mark. Here's what I got on 10.4.11: Code: while true;do ps a|grep ps|grep -v grep|awk '{print $1}';done [...] 29991 29995 29999 104 108 112 [...]
__________________ Cyber Feen Blog |
|
#7
| ||||
| ||||
| I thought it was well documented... I'm pretty sure it is somewhere on ADC site, but not just too obviously visible I guess. When ever my uptimes get to 150 days or more, how could the PIDs be otherwise on the range of under 32,000? I discovered the PID thing years ago, in 10.3 times, when my uptime was a few months, and new processes didn't seem to get any higher pids for top. All new processes were around 22000 on the second or third round... Now that I check it, the PID recycling seems to occur only in 10.4 and before (or maybe 10.3 and before?). On the MacBook next to me, with uptime of 18 days, I get highest PID reported as 66859. Good. At least one more thing standardized. |
|
#8
| ||||
| ||||
| Doesn't wrap for me: 47435 (OS X 10.5.3)
__________________ michaelsanford.com Blog Twitter Tumblr LinkedIn iMac Aluminum 24" | MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2120 GB RAID 1, 2500 GB RAID 0 |
![]() |
| Tags |
| pid, process, terminal |
| Thread Tools | |
|
|