Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Q: How get free/used memory totals?

Q: How get free/used memory totals?
Thread Tools
Dedicated MacNNer
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 1, 2005, 01:39 PM
 
Something like 'free' from unix and not vm_stat so that I can get simple free and used memory totals in MB? Any other suggestions? Thanks.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 1, 2005, 02:22 PM
 
Code:
top -l 1 -n 0
.. and then use the usual methods of getting the exact bits you want (grep, awk, perl, etc...)

But all the usual caveats about knowing what they really mean (that can be non-obvious) apply.
     
jgift  (op)
Dedicated MacNNer
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 1, 2005, 03:25 PM
 
Great. Didn't think of Top... Is it as accurate as a 'free'? I'd heard rumors and was wondering. Right now I'm using a long winded vm_stat configuration.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 1, 2005, 04:02 PM
 
What *exactly* are you looking for. Different methods will give you different results because there are subtle differences in what they are exactly telling you. If you are simply reporting this back to the user... well at least this number will be somewhat consistent with other methods they might be looking at.
     
jgift  (op)
Dedicated MacNNer
Join Date: Feb 2003
Status: Offline
Reply With Quote
Mar 2, 2005, 01:23 AM
 
I'll use this. Thanks for the comments, it's appreciated.
     
   
Thread Tools
Forum Links
Forum 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 On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:45 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2