vmstat and memory reporting!!

vmstat and memory reporting!!

Post by Sundar R. Srira » Fri, 31 Aug 2001 03:27:23



Hi All,

When i use vmstat, i get information which is averaged over a time interval.
The first row being since boot time and the following rows of information
is over the interval specified. I understand the output of vmstat and also other
tools
like cpustat, cputrack, pmap, iostat and prstat.
***************Example**********
w-srsriram>> vmstat 5 5
 procs     memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr aa dd f0 --   in   sy   cs us sy id
 0 0 0 1176072 144784 0   7  4  0  0  0  0  0  0  0  0  236  742   71  1  1 98
 0 0 0 1150520 98288  0   0  0  0  0  0  0  0  0  0  0  364 1540  190  1  1 98
 0 0 0 1150432 98200  0   8  0  0  0  0  0  0  0  0  0  370 2312  250  1  1 97
 0 0 0 1150304 98072  0   0  0  0  0  0  0  0  0  0  0  286 2069  229  1  0 99
 0 0 0 1150304 98072  0   0  0  0  0  0  0  0  5  0  0  306 1839  207  0  1 98

w-srsriram>>
**********End Example**************
In vmstat, i can understand averaging the values for CPU usage by a process in a
time interval T. One can see the values in the raw counters being updated.

My understanding is that:
the free memory in the system = free list pages + cache list pages.

So why do we take an average over interval of time T for memory usage?
Ideally, the free memory should be the addition of these 2 variables and not an
average.

How does Solaris store the information about memory usage by process and on a
system wide basis? How does Solaris compute/store free memory in the system?

Why do i need to average free memory values in vmstat?

The motivation for this is that i have built a tool which monitors system
resources by getting and processing "kstat" infromation. If i dont' average the
free
memory, i get some very very long number. If i average it, i get the right value
as
returned by vmstat.

I would appreciate your pointers to help  understanding this,

Kind regards
Sriram

 
 
 

vmstat and memory reporting!!

Post by Darren Dunha » Fri, 31 Aug 2001 06:14:53



Quote:> In vmstat, i can understand averaging the values for CPU usage by a
> process in a time interval T. One can see the values in the raw
> counters being updated.
> My understanding is that:
> the free memory in the system = free list pages + cache list pages.
> So why do we take an average over interval of time T for memory usage?
> Ideally, the free memory should be the addition of these 2 variables
> and not an average.

Because the variables change over time?  vmstat shows averages.  If you
want to see "snapshot" values, use another tool like 'swap' or something
that reads the kstat fields directly.

Quote:> How does Solaris store the information about memory usage by process

In the process structure.  You can query an individual process for the
memory usage with pmap (pmap -x being more detailed).

Quote:> and on a system wide basis? How does Solaris compute/store free memory
> in the system?

Depends on the OS, but it basically keeps track of a "free list" of
pages.  As pages are needed, the OS removes them from the list.  As
pages are reclaimed, they go back on the list.

Quote:> Why do i need to average free memory values in vmstat?

I don't know that you do.  That's what vmstat does, though.

Quote:> The motivation for this is that i have built a tool which monitors
> system resources by getting and processing "kstat" infromation. If i
> dont' average the free memory, i get some very very long number. If i
> average it, i get the right value as returned by vmstat.

I don't understand that..  You're saying that averaging turns a long
number into a small number?  Are you averaging, or are you showing the
difference or what?

Exactly which kstat object are you querying?

(and what OS are you running?)

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >

 
 
 

1. memory reported by vmstat

Hi,

Could someone help explain how vmstat calculates the free memory and swap
space on Solaris 2.3? I have had a hard time to figure out where all my
memory goes. What I did was adding up the memeory size (ps -elf) used by
each processes. It seems we have couple hundred MB missing somewhere.
Thanks for the help.

-Phil

2. Don't support DIVX

3. vmstat and memory reporting

4. sdfsdf

5. Linux directorys (Redhat 4.1)

6. vmstat | sed WORKS vmstat | logger WORKS vmstat | sed | logger FAILS

7. kdesu

8. vmstat | sed WORKS vmstat | logger WORKS vmstat | sed | logger FAILS - NEED HELP

9. Total memory reported / memory used

10. Matrox Mystique ands X.

11. to less memory shown/used with vmstat

12. SUNOS vmstat memory fre - decrease