Saturday, January 1, 2011

Check free memory in solaris

[root@host1 ~]# sar -r

SunOS host1 5.10 Generic_142900-13 sun4u    09/15/2010
00:00:08 freemem freeswap
00:15:06 19557199 257224020
00:30:07 19568546 259068172
00:45:06 19270095 258003409
[root@host1 ~]# pagesize
8192
[root@host1 ~]#
So formula is
Free Memory= 19557199*8 = 156457592kb =152790Mb=149Gb
Dont apply this on Linux , It show in different way.
Or use VMSTAT
[root@host1 ~]#
[root@host1 ~]# vmstat 2 10
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr s0 s1 s2 s3   in   sy   cs us sy id
 2 20 0 154718432 190199784 1811 5261 1677 4992 4990 0 0 149 9 9 149 46293 278630 61146 4 6 90
 26 0 128356800 150948664 2617 5529 11383 0 0 0 0 179 0 0 179 55395 286775 67779 5 11 84
Free Memory=(190199784/1024/1024)Gb

And to check what is physical memory you have in system
# prtconf -vp | grep -i mem
Memory size: 16384 Megabytes


And to see there bank , chip size.
:47 PMddcspwlg05 root4 prtdiag -v
System Configuration:  Sun Microsystems  sun4u Sun Fire 480R
System clock frequency: 150 MHz
Memory size: 16384 Megabytes
========================= CPUs ===============================================
          Run   E$  CPU     CPU
Brd  CPU  MHz   MB  Impl.   Mask
— —– —- —- ——- —-
 A     0  1200  8.0 US-III+  11.1
 A     2  1200  8.0 US-III+  11.1
========================= Memory Configuration ===============================
          Logical  Logical  Logical
     MC   Bank     Bank     Bank         DIMM    Interleave  Interleaved
Brd  ID   num      size     Status       Size    Factor      with
—  —  —-     ——   ———–  ——  ———-  ———–
 A    0     0      2048MB   no_status    1024MB     8-way        0
 A    0     1      2048MB   no_status    1024MB     8-way        0
 A    0     2      2048MB   no_status    1024MB     8-way        0
 A    0     3      2048MB   no_status    1024MB     8-way        0
 A    2     0      2048MB   no_status    1024MB     8-way        0
 A    2     1      2048MB   no_status    1024MB     8-way        0
 A    2     2      2048MB   no_status    1024MB     8-way        0
 A    2     3      2048MB   no_status    1024MB     8-way        0

========================= IO Cards =========================

2 comments: