Free memory in top and prstat command

Hi Export,

i execute 'top' command to show the free memory in Solaris host, but the read is much lower than the RSS value shown in prstat command. Which one can reflect the real status and it is possible the difference caused by any patch of OS?

Top command (only 883 memory is free)

load averages: 2.10, 2.00, 2.13; up 28+22:08:02
265 processes: 262 sleeping, 3 on cpu
CPU states: 69.6% idle, 14.3% user, 16.1% kernel, 0.0% iowait, 0.0% swap
Memory: 16G phys mem, 883M free mem, 30G total swap, 30G free swap

Prstat (4G memory used )
20100513164128548.png - solaris - eiga??? @ Xuite ??

Thanks in advance

Memory statistics like the column free in top and used in prstat (RSS per process and under total) have special meaning because these utilities sum up the shared memory for every process attached to a shared memory segment.

And in some cases the result, of course, is incorrect ...

On Solaris use vmstat (free in KB) or sar (sar -r, freemem in pages (use pagesize to see the size)) to see how much physical memory is free.

I also believe that those numbers (vmstat an sar) could be used for rough estimation only.

I suppose that the real indicators for memory shortage are the excessive paging or swapping and sr (scan rate - vmstat -> page -> sr).

prstat does not show free memory but rather what's in memory. you will need to check out sar -r or vmstat as radoulov suggested.

I know the OP was in regard to top and prstat output differences. however, may i suggest this reading - [http://www.princeton.edu/~unix/Solaris/troubleshoot/ram.html]

you might find some very useful information.

And for accurate free memory metrics, you can use this command as root:

echo ::memstat | mdb -k