LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 08-25-2005, 05:29 AM   #1
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES11 / FC20/ OES / CentOS
Posts: 606

Rep: Reputation: 32
free physical memory


Hello!

I simply would like to find out how much physical memory is free on my server ?

Something like 'free -m'

Thanks !
 
Old 08-25-2005, 07:11 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
vmstat's column "free" reports free physical memory available.
ignore the first sample, as it's the average since last reboot.
 
Old 08-25-2005, 01:21 PM   #3
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Yup use vmstat or prtconf as described here :
http://www.cyberciti.biz/nixcraft/vi...mation-or.html
 
Old 08-25-2005, 02:00 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
prtconf doesn't report free memory but installed memory.
 
Old 08-26-2005, 07:40 AM   #5
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES11 / FC20/ OES / CentOS
Posts: 606

Original Poster
Rep: Reputation: 32
thanks

what vmstat says:

procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr s6 sd sd sd in sy cs us sy id
0 0 0 12860632 5120448 114 590 631 1 1 0 0 0 4 4 8 77 148 324 79 16 5
0 0 0 12676104 4893432 1 368 0 0 0 0 0 0 7 5 6 5017 14614 9011 31 7 62
0 0 0 12676072 4893400 0 197 0 0 0 0 0 0 1 1 7 3619 13456 8272 21 6 73

so the last line would sys I have 4893400 kb of free memory.

so 4893400 / 1024 = 4778 MB free ????

How do I get to MB ?
 
Old 08-26-2005, 11:30 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
Quote:
so 4893400 / 1024 = 4778 MB free ????
Precisely, you have 4.66 GB free.

Here's the bigger machine I'm currently running:

I has 48 Gigabytes of RAM
Code:
$ prtconf | head -2
System Configuration:  Sun Microsystems  sun4u
Memory size: 49152 Megabytes
It has plenty of that memory currently unused:
Code:
 $ vmstat 1 2
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 s3 s3   in   sy   cs us sy id
 0 0 0 46338392 43237520 10 44 7 4 4  0  0  1  1  2  1  327 1638  518  1  0 99
 0 0 0 49814392 47284968 0 8 0  0  0  0  0  0  0  0  0  302  328  458  0  0 100
which I can convert to 46176 MB or 45.09 GB.
Code:
$ bc
scale=2
47284968/1024
46176.72
47284968/1024/1024
45.09
My laptop is less lucky:
Code:
$ prtconf -v | head -2
System Configuration:  Sun Microsystems  i86pc
Memory size: 511 Megabytes
$ vmstat 1 2
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr cd s0 -- --   in   sy   cs us sy id
 0 0 0 865600 254276 15  97  9  0  0  0 11  2  0  0  0  269 1088  381  9  2 89
 0 0 0 837036 221256  0   7  0  0  0  0  0  0  0  0  0  311 2334  534  6  0 94
216 MB free ...
 
Old 08-26-2005, 12:49 PM   #7
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,452

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
Incidentally, it is a Good Thing for physical memory to be as full as possible. If there's anything out there that it could contain, then it is advantageous for something to be there.

Linux will naturally use "free" memory for buffers of various sorts .. so-called shared memory. As the system begins to experience memory pressure, that allocation may start to go down, because buffers are a lower-priority use of memory.

The key performance-figure is to observe, not so much "what is the system is doing," but "who is experiencing pain because of it?" How many processes are experiencing substantial involuntary waits due to paging? How many of them are unable to achieve keeping their working-sets (the amount of memory they would like to have right now) in-memory? You need to somewhat-disregard the behavior that an application may experience while it is starting-up, but when it is stable and has been running for a minute or so, you can tell if it's "crying" or not.
 
Old 08-26-2005, 01:22 PM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
No doubt maximizing memory use is a "Good Thing" (tm), and Solaris is pretty efficient at it.
That said, when you have 48 Gigabytes, on a quiet day that's hard to fill ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Less physical memory? ariek Debian 5 07-21-2005 03:23 PM
How to access physical memory in C? cyu021 Programming 6 03-27-2005 05:16 AM
get Physical memory in C/C++ Dreampainter Programming 1 10-30-2004 09:54 PM
Physical memory usage piglingz Linux - Hardware 3 04-06-2003 10:07 PM
How Much Physical Memory ? tied2 Linux - Newbie 3 06-17-2002 02:30 AM


All times are GMT -5. The time now is 07:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration