image
image

Go Back   macosx.com > Community > Bob's Place

Reply
 
Thread Tools
  #1  
Old May 29th, 2008, 04:44 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
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, 2•120 GB RAID 1, 2•500 GB RAID 0

Last edited by michaelsanford; May 29th, 2008 at 04:45 PM. Reason: Added `grep -v grep` which I *always* forget.
Reply With Quote
  #2  
Old May 29th, 2008, 04:46 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
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, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #3  
Old May 29th, 2008, 05:05 PM
Viro's Avatar
Registered User
 
Join Date: Nov 2003
Location: Oxford, UK
Posts: 2,492
Thanks: 0
Thanked 1 Time in 1 Post
Viro will become famous soon enoughViro will become famous soon enough
1511.
Reply With Quote
  #4  
Old May 29th, 2008, 06:06 PM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 7,763
Thanks: 2
Thanked 23 Times in 23 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
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...
__________________
MacBook Pro + Mac mini | Newton 2000 | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #5  
Old May 29th, 2008, 06:58 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
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, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
  #6  
Old May 30th, 2008, 07:58 AM
macbri's Avatar
Mac (r)evolution
 
Join Date: Jun 2005
Location: Ireland
Posts: 255
Thanks: 1
Thanked 0 Times in 0 Posts
macbri is on a distinguished road
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
Wrapped for me here:

[...]
29991
29995
29999
104
108
112
[...]
__________________
Cyber Feen Blog
Reply With Quote
  #7  
Old May 30th, 2008, 08:27 AM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 7,763
Thanks: 2
Thanked 23 Times in 23 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
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.
__________________
MacBook Pro + Mac mini | Newton 2000 | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #8  
Old June 2nd, 2008, 08:56 PM
michaelsanford's Avatar
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,174
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
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, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote
Reply

Tags
pid, process, terminal

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 11:58 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.