Anyone help to interpretate os statistics

Hi,

Can anyone help me to explain following statistics of my unix box.

/usr/sbin/swap -l 
swapfile dev swaplo blocks free  
/dev/dsk/c4 118,771 16 33560432 33319776 
/dev/dsk/c4 118,763 16 33560432  33327184 
/usr/sbin/swap -s 
total: 13429368k bytes allocated +  9830880k reserved = 23260248k used, 19836488k available 
vmstat 2 10  
kthr memory page disk faults cpu 
r b w swap free re mf pi po fr de sr m1  m1 m1 m2 in sy cs us sy id 
2 0 0 19487048 7841432 6125 3258 77664 173 172 0  1 4 0 1 4 13260 18444 9986 37 12 51 
0 0 0 19833456 8558136 1283 6426 18014  47 47 0 0 13 0 0 13 2883 16154 3389 6 9 85 
0 0 0 19843856 8563872 1287 6675  16380 207 207 0 0 17 2 0 17 3154 16243 2914 7 8 85 
0 0 0 19845080 8564240  345 18 15058 0 0 0 0 0 0 0 0 3007 1056 1787 3 1 95 
0 0 0 19828744 8544472  1685 7569 8983 40 36 0 0 15 0 0 15 4843 19042 4446 10 11 78 
0 0 0 19845848  8553488 1241 5343 14277 279 279 0 0 5 0 0 5 4827 11690 3605 6 7 87 
0 0 0  19845848 8530856 352 69 2162 0 0 0 0 0 0 0 0 11214 2556 4523 5 3 92 
0 0 0  19845848 8498616 46 11 195 0 0 0 0 0 0 0 0 11324 2326 4255 5 3 92 
0 0 0  19831616 8460432 2073 12800 207 759 755 0 0 25 0 0 25 12545 28490 7666 12 18 70  
0 0 0 19845720 8442104 44 217 164 359 359 0 0 1 0 0 0 11048 2281 4180 4 3 92  
ipcs -pmb 
IPC status from <running system> as of Tue Jun 21  05:48:16 EDT 2011 
T ID KEY MODE OWNER GROUP SEGSZ CPID LPID 
Shared  Memory: 
m 17 0xcf8f2fcc --rw-r----- oracle dba 8192 1019 12404 
m 16 0  --rw-r----- oracle dba 150994944 1019 12404 
m 15 0 --rw-r----- oracle dba  150994944 1019 12404 
m 14 0 --rw-r----- oracle dba 134217728 1019 12404  
m 13 0 --rw-r----- oracle dba 805306368 1019 12404 
m 11 0xf2bc407c  --rw-r----- oracle dba 16384 913 17935 
m 10 0 --rw-r----- oracle dba  553648128 913 17935 
m 9 0 --rw-r----- oracle dba 603979776 913 17935 
m 8  0 --rw-r----- oracle dba 536870912 913 17935 
m 7 0 --rw-r----- oracle dba  3690987520 913 17935 
m 5 0x12882000 --rw-r----- oracle dba 32768 694 17458  
m 4 0 --rw-r----- oracle dba 1660944384 694 17458 
m 3 0 --rw-r-----  oracle dba 1677721600 694 17458 
m 2 0 --rw-r----- oracle dba 1660944384 694  17458 
m 1 0 --rw-r----- oracle dba 7902068736 694 17458 

I am confusing about to say how much real memory consuming and free size of real memory.

Thanks and regards,
gt

Please run the following commands and provide output:

top
prtconf -v|grep -i memory

So to make sure i understand you want to know real free and used memory and total correct?

"top" is not part of the solaris installation... use "prstat" instead...

Thanks DukeNuke2, I am used to having top available to me but forgot it wasnt installed by default. giteshtrivedi you can download top from Sunfreeware - Free and Open Source Software (FOSS) for Sun Microsystem's Solaris if you would like to use it. It comes in handy quite a bit. Once you run these commands and provide the output then I will try to help you understand your memory situation from there.

Thanks

You have about 8 GB of RAM free, which should be considered quite enough in most cases. All the other memory statistics you posted are referring to virtual memory, not physical one.

I wouldn't recommend using top which depending on the version might report confusing statements on Solaris.

For detailed RAM usage statistics, you can use

echo ::memstat | mdb -k

Hi,

For installing TOP in system, we need approval and it is long process.

/usr/sbin/prtconf -v|grep -i memory
Memory size: 24576 Megabytes

memstats not found and got error

So from the prtconf output you have about 24GB memory total in the machine. What other information were you looking to get from the machine?

The below script will show you from smallest to largest the memory usage of each process:

The following shell script prints the memory usage of each process, sorted by ascending memory usage.

#!/bin/sh

/usr/bin/printf "%-6s %-9s %s\n" "PID" "Total" "Command"
/usr/bin/printf "%-6s %-9s %s\n" "---" "-----" "-------"

for PID in `/usr/bin/ps -e | /usr/bin/awk '$1 ~ /[0-9]+/ { print $1 }'`
do
   CMD=`/usr/bin/ps -o comm -p $PID | /usr/bin/tail -1`
   # Avoid "pmap: cannot examine 0: system process"-type errors
   # by redirecting STDERR to /dev/null
   TOTAL=`/usr/bin/pmap $PID 2>/dev/null | /usr/bin/tail -1 | \
/usr/bin/awk '{ print $2 }'`
   [ -n "$TOTAL" ] && /usr/bin/printf "%-6s %-9s %s\n" "$PID" "$TOTAL" "$CMD"
done | /usr/bin/sort -n -k2

Hi jtwcarboy,

Thanks a lot for prompt response. I need to figure out how much real memory is free because I need to expand one database memory. Could you tell me how can I see that?

Take a look at the below command and output. It seems to break things down well:
This is from a machine with 64Gb of Memory and this row shows the f ree memory:
Free (freelist) 13096905 51159 78%

#  echo ::memstat | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     646470              2525    4%
ZFS File Data             1920208              7500   11%
Anon                      1078294              4212    6%
Exec and libs               14431                56    0%
Page cache                   2544                 9    0%
Free (cachelist)            13012                50    0%
Free (freelist)          13096905             51159   78%

Total                    16771864             65515
Physical                 16324293             63766

I already wrote you have 8 GB free.
Is there anything that makes you believe this is incorrect ? Or perhaps by "real memory" you mean something different than RAM ?

I corrected a typo, you can run

echo ::memstat | mdb -k

and post its output.