From: alan@shodha.enet.dec.com ( Alan's Home for Wayward Notes File.)
Newsgroups: comp.unix.admin
Subject: Re: Active Virtual Memory: Useful or Useless Statistic?
Summary: They both are.
Date: 14 Apr 92 15:58:58 GMT
Organization: Digital Equipment Corp. - Colorado Springs, CO.



In article <1992Apr13.135206.28959@nic.unh.edu>, pas@anchor.unh.edu (Paul A Sand) writes:
> [ A paper included in the Monitor distribution and a publication
>   are observed to have opposite opinions of the usefulness of
>   active virtual memory.  Which is right? ]

They both are.  Both are opinions.  At least in the parts quoted
neither author gives a detailed explaination of why he feels that
AVM is useful or not.  Without the rationale for the opinion we
can only acknowledge that each is entitled to an opinion and that
opinions often differ.

I'll offer an additional opinion.  The active virtual memory statistic
indicates the amount of virtual memory that is trying to put to use
at any given time.  If this is in excess of the physical memory 
available for use at that time, then the system will have to page
parts of processes to and from backing store to give all processes
an equal enough chance to run.  In extreme circumstance the kernel
may find it simplier to swap the process rather than page it.

The magnitude of this difference between available physical memory
and active virtual memory would seem to be interesting number.  If
the magnitude of the number is small and there isn't enough physical
memory available, then the system will probably page very little.
So little in fact that programs that sleep a lot may be stripped
of pages they haven't used in a long time.  The shortfall may last
for a short time, while the pages that will never be used again
are thrown out or paged out.  If the magnitude is large (and there 
isn't enough physical memory), then the system will be actively paging 
and perhaps swapping.

Can this magnitude be derived from other sources?  Well, the free
list is one place to start looking.  As free memory becomes more
and more scarce the size of the list gets smaller and smaller.  But
it probably never goes negitive.  At least on ULTRIX systems it
can become very small, but eventually hovers around some seemingly
magical value of approximately 500 KB.  Clearly this will never
exactly match the magnitude of the short fall between AVM and
available physical memory.

One thing the magnitude of the difference suggests is how much
the system *should* be paging.  As noted before if the magnitude
is great, then there should be lots of paging related I/O.  If
the magnitude is small, there should be little paging I/O.  Well,
ULTRIX also keeps track of the amount of paging I/O.  It seems
it would almost be simplier to look directly at the amount of
paging there IS, than look at how much there *should* be.  Perhaps
it is useful to verify from a different source that you really are
seeing what you should be seeing, but the fact that the system is
paging heavily is probably evident in other ways.

It may come down to how the data is displayed or how easy it is
for the data to be displayed.  For Monitor, the AVM is close to
the top and slightly right of center.  The paging information is
on the two lines below, with the number of paging operations
on the 2nd line to the far left.  My inclination is that it is
probably easier to pick out a high paging opertions than it is
to go through the math necessary for the memory statistics, which
I don't even think is all there.  A different display may make it
easier to pick out that there probably is paging, than observe that
there is indeed paging.

> -- 
> -- Paul A. Sand
-- 
Alan Rollow				alan@nabeth.cxo.dec.com

Xref: sparky comp.unix.admin:2826 comp.unix.shell:2088