Visit Our UNIX and Linux User Community

Free memory in top and prstat command

Thread Tools Search this Thread
Operating Systems Solaris Free memory in top and prstat command
# 1  
Old 05-13-2010
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
# 2  
Old 05-13-2010
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).

Last edited by radoulov; 05-14-2010 at 04:20 PM..
# 3  
Old 05-14-2010
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 - []

you might find some very useful information.
# 4  
Old 05-14-2010
And for accurate free memory metrics, you can use this command as root:
echo ::memstat | mdb -k

Previous Thread | Next Thread
Test Your Knowledge in Computers #482
Difficulty: Medium
in 2018, developers and programmers rarely used an Integrated Development Environment (IDE) that provided a text editor with code highlighting.
True or False?

10 More Discussions You Might Find Interesting

1. Red Hat

Need help on top and free command.

Hi, from below output.How to read or relate one marked in bold. $ free -m total used free shared buffers cached Mem: 129176 92753 36423 0 2268 39973 -/+ buffers/cache: 50511 78664 Swap: 31996 ... (1 Reply)
Discussion started by: manoj.solaris
1 Replies

2. Shell Programming and Scripting

Format Top and prstat command output

need help with formatting output of command top and prstat. My requirment is to remove few columns and display remaining . But when i used awk to do that the output seems to be have gone vague, mixing the column values. After using awk to print particular column the output seems to have lost... (1 Reply)
Discussion started by: NarayanaPrakash
1 Replies

3. Solaris

Physical and Free mem on TOP command

Hi, When I run the free command on solaris, I get the following: "Memory: 60G phys mem, 69G free mem" Q: how cna the free mem be higher then the physical mem?:confused: Amit (3 Replies)
Discussion started by: amitlib
3 Replies

4. Shell Programming and Scripting

Swap usage by top and free command doesn't match

Its rather confusing, the output of top command is below: The "swap" field of top is described by the manpage as: "The swapped out portion of a task's total virtual memory image." But the output of free command suggests something else and it does tally with the output of swapon... (3 Replies)
Discussion started by: proactiveaditya
3 Replies

5. Solaris

Memory usage, free and used, using sar, top and vmstat in Solaris zone/container

Hi all, I have a server running an Oracle database that is part of a Solaris M5000 container. Presumably this is referred to as a zone within a cluster, not sure if I get the terminology right. Anyway, a third-party manages the zone and unfortunately is not "helpful/friendly" to assist me on... (1 Reply)
Discussion started by: newbie_01
1 Replies

6. Shell Programming and Scripting

Command to find the Memory and CPU utilization using 'top' command

Hi all, I found like top command could be used to find the Memory and CPU utilization. But i want to know how to find the Memory and CPU utilization for a particular user using top command. Thanks in advance. Thanks, Ananthi.U (2 Replies)
Discussion started by: ananthi_ku
2 Replies

7. UNIX for Dummies Questions & Answers

diff between prstat and top

what is the diff between prstat and top command in unix? can anyone tell me please? (2 Replies)
Discussion started by: venkatesht
2 Replies

8. Shell Programming and Scripting

how can i extract only the Memory line from top command ?

Hello all i need in csh to extract only the Memory line from the out put of the top command how can it easily done (1 Reply)
Discussion started by: umen
1 Replies

9. Solaris

Top and Prstat display different results for memory

I have a question about the accuracy of prstat. I did a 'prstat -t' and it shows 99% of my memory is occupied by oracle. NPROC USERNAME SIZE RSS MEMORY TIME CPU 194 oracle 343G 340G 99% 86:17.24 56% However, 'top' shows I still have 7762meg of memory free. Memory: 16G real, 7762M... (4 Replies)
Discussion started by: zen03
4 Replies

10. UNIX for Advanced & Expert Users

unix top command (memory usage)

in unix when i use top i get an output like this: load averages: 0.64, 0.57, 0.53 14:04:42 347 processes: 1 running, 1 waiting, 169 sleeping, 172 idle, 4 stopped CPU states: 16.4% user, 2.8% nice, 7.6%... (2 Replies)
Discussion started by: gfhgfnhhn
2 Replies

Featured Tech Videos