How to find out the memory usage in Solaris?

Hi All,
In one of the solaris box aslert got triggered as ...

(Used_Real_Mem_Pct=93.0 Used_Swap_Space_Pct=75.0 )] 

when i see the usage by vmstat and sar i am not able to relate the alert with the free memory and swap memory

please help to understand the vmstat output as below..

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
 0 0 0 45522156 17792856 2837 11941 1954 203 198 0 9 5 -0 16 162 9313 77359 9757 2 2 96

currently 32 GB RAM is there..

ncmsas:/data2/users/mhdb $ swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c1t0d0s1   30,1       8 67119560 30841936

please help to understand what is real used memory =93.0 and swap_sace_pct=75.0

The statistics reported by your monitoring tool do not match the vmstat and swap output, not to mention there are multiple definition of what free RAM and free swap mean and it is unclear which one it picks.

In any case, there might have been a transcient event where most RAM and a lot of swap were used but had resumed to normal when you ran the vmstat/swap commands.

I would recommend running also "swap -s" and "echo ::memstat | mdb -k" to get a better idea of the memory usage.

I suggest to find out which process(es) is/are causing the most memory. Use

ps -Ao vsize[,<other-args>] | sort

to get the amount of memory (in KB) allocated by each process. For the other args to identify the processes consult the man page of ps .

I hope this helps.

bakunin

Another point, your vmstat output only displays the first line of statistics.
This represent the average value since last boot (or counter rollout). You should post at least two lines of values to get the current metrics.
The 'sr' column is showing a non null value (9) that clearly means the system suffered some RAM shortage.

You can try sar command to get free memory.

$sar -r 2 2

SunOS 5.10 Generic_141414-09 sun4u 09/03/2014

07:46:33 freemem freeswap
07:46:35 350888 24634608
07:46:37 350887 24634576

Average 350888 24634592