The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. July 03, 2009, 04:48:06 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Linux QQ - how much RAM is left?  (Read 969 times)
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 6011



View Profile
« on: September 19, 2007, 12:43:55 PM »

Probably a stupid question, but other than "top" is there a quick and easy way to see how much usable RAM (not swap) is left on a box? I am trying to tune some caching systems and would like to monitor the cache and free mem for a few days...
Logged

Don't make me... Get off my lawn.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 1225


View Profile
« Reply #1 on: September 19, 2007, 11:17:26 PM »

you mean like this Huh?

:/proc$ cat meminfo
MemTotal:      1555656 kB
MemFree:        718176 kB
Buffers:         27056 kB
Cached:         379328 kB
SwapCached:          0 kB
Active:         462252 kB
Inactive:       292772 kB
HighTotal:      655040 kB
HighFree:         1144 kB
LowTotal:       900616 kB
LowFree:        717032 kB
SwapTotal:     4915880 kB
SwapFree:      4915880 kB
Dirty:              64 kB
Writeback:           0 kB
AnonPages:      348676 kB
Mapped:          95268 kB
Slab:            50088 kB
SReclaimable:    35920 kB
SUnreclaim:      14168 kB
PageTables:       2924 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   5693708 kB
Committed_AS:  1120400 kB
VmallocTotal:   114680 kB
VmallocUsed:     15956 kB
VmallocChunk:    97120 kB
Logged
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 1225


View Profile
« Reply #2 on: September 19, 2007, 11:18:51 PM »

lots of cool shit in there
/proc$ cat stat
cpu  20823 111 2260 208161 9617 494 180 0
cpu0 13793 5 1572 97490 7317 494 177 0
cpu1 7029 106 688 110671 2299 0 3 0
intr 595492 302441 1813 0 2 0 0 0 0 34 7884 0 0 1693 0 20531 3040 112825 0 117301 381 18535 0 2 9010 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 1822064
btime 1190267920
processes 7013
procs_running 1
procs_blocked 1
Logged
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 1225


View Profile
« Reply #3 on: September 19, 2007, 11:19:15 PM »

i forgot about that thanx for reminding me
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 6011



View Profile
« Reply #4 on: September 20, 2007, 09:05:45 AM »

Hey nop - that looks delightful, but where would the meminfo file or stream live? Can't find it on my unix or linux boxes
Logged

Don't make me... Get off my lawn.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 1225


View Profile
« Reply #5 on: September 20, 2007, 03:11:42 PM »

Huh?
maybe it some strange linux system, i do not know if unix have this.
they do not have a /proc directory
all that stuff live in /proc

search on G for "/proc"
freebsd have this directory etc.

woops forgot to mention
if my faulty memory serves me correct be careful when playing with those files in that directory, especially if u root.
i can not remember the exact details, or maybe it another directory Smiley
but you could use it to modify memory.
« Last Edit: September 20, 2007, 03:14:32 PM by nop_90 » Logged
thedarkness
Global Moderator
Lifer
*****
Offline Offline

Posts: 585



View Profile
« Reply #6 on: September 20, 2007, 05:12:42 PM »

/proc/meminfo doesn't exist in freebsd (whch macos is based on)

Maybe try "sysctl -a" or "pstat" to get you started.......?

HTH,
td
Logged

"I want to be the guy my dog thinks I am."
 - Unknown
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 6011



View Profile
« Reply #7 on: September 20, 2007, 05:25:13 PM »

@Nop - found it in RedHat 9 - probably elsewhere as well, but that's a start thanks. As it turns out, the place I need to monitor is that system, so that's a plus for now anyhoo...

@TD - sysctl is there - cripes what a list (sysctl -A) - what is pstat? Can't find that one...
Logged

Don't make me... Get off my lawn.
thedarkness
Global Moderator
Lifer
*****
Offline Offline

Posts: 585



View Profile
« Reply #8 on: September 22, 2007, 08:12:22 PM »

BSD specific I believe perk
Logged

"I want to be the guy my dog thinks I am."
 - Unknown
ratthing
Journeyman
***
Offline Offline

Posts: 75


View Profile
« Reply #9 on: October 27, 2007, 11:17:20 AM »

Late to the party (what else is new?).  Also check out "free" and "vmstat" ("vm_stat" on OS X).

What someone else said about /proc...be careful in there as root, you can hork up your system pretty easily.

=RT=
Logged
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 6011



View Profile
« Reply #10 on: October 27, 2007, 11:56:41 AM »

$<parse> =  shell_exec('free');

D'oh!

Like it RT
Logged

Don't make me... Get off my lawn.
ratthing
Journeyman
***
Offline Offline

Posts: 75


View Profile
« Reply #11 on: October 29, 2007, 12:51:50 PM »

I live to serve!  Grin You're welcome.
Logged
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!