freemem - a free memory monitor for HP-UX


Freemem is freeware. It lets you see the values of some of the kernel parameters, thresholds, and values that will give you a really good idea about how memory is being used by HP-UX. This utility is a spinoff from our development of SarCheck for HP-UX, and we're providing it for free as a way of thanking the HP-UX community for the success of SarCheck. The default output of freemem looks like this:

freemem= 1612 gpgslim= 133 lotsfree= 535 desfree= 133 bufpages= 3275 dbcminpgs= 3276 dbcmaxpgs= 6554 minfree= 33 for info: freemem -help

You can timestamp the output and get rid of the message at the end with the -q and -t switches, and you'll get this:

14:55:37 freemem= 1568 gpgslim= 133 lotsfree= 535 desfree= 133 bufpages= 3275 dbcminpgs= 3276 dbcmaxpgs= 6554 minfree= 33

More information about switches can be found in the usage text. This page contains the usage text, license text, information on how to interpret freemem's output, how to graph freemem output with gnuplot, and finally, a downloadable copy of freemem.

requirements

Resource utilization is trivial. You do not need to be root to run freemem. The one binary seems to work properly on operating systems from 10.10 to 11.22, with 32-bit or 64-bit operating systems, and with both PA RISC and Itanium systems. It was compiled on a PA RISC system and will use more CPU time on an Itanium, but CPU utilization should still be a small fraction of a second of one processor's time.

usage text

usage:  freemem [-q] [-t] [-license]

-q         don't append messages to the end of the output line

-t         precede the output with a timestamp

-license   send the license agreement to stdout

This program sends the values of various pstat data to stdout in a
parsable format.  Any invalid argument or incorrect number of
arguments will cause this usage text to display instead of the
expected data.  This program was designed to gather datafrom the
pstat interface and make it available for use by human performance
analysts or by our SarCheck performance analysis utility.  More
information about SarCheck can be found at www.sarcheck.com

Please take a look at the license agreement for this program.  It's
free to use and distribute, and the details can be seen by using
the -license switch, ideally piped to more because it's about 70
lines long.  We hope that it helps you to better understand the way
your system uses memory.

Copyright 2002 by Aptitune Corporation, Plaistow NH USA
http://www.aptitune.com/
http://www.sarcheck.com/

license text

Aptitune Corporation
PO Box 1033, Plaistow NH 03865 USA
email: sales@sarcheck.com
Phone: 1-603-382-4200; Fax: 1-603-382-4247
http://www.sarcheck.com

FREE SOFTWARE LICENSE AGREEMENT
TERMS AND CONDITIONS


CAREFULLY READ ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT. 
USING THIS PROGRAM CONSTITUTES YOUR ACCEPTANCE OF THESE TERMS 
AND CONDITIONS.

If you do not agree to the following terms and conditions, no 
license is granted hereunder and you are not authorized to use 
Aptitune Corporation's freemem program.

1. LICENSE: Aptitune grants to you a royalty-free, worldwide, 
perpetual, right and license to use the Program, including the 
right to make copies of the Program. YOU MAY NOT DECOMPILE, 
REVERSE ENGINEER, OR OTHERWISE DISASSEMBLE OR MODIFY THE 
PROGRAM OR ANY PART THEREOF.

2. In the event that you copy or transfer the Program, you 
agree to reproduce the Program in its entirety, including the 
copyright notice.

3. TERMINATION: This license will terminate immediately and 
without notice upon your failure to comply with any term or 
condition of this Agreement. You agree, upon such 
termination, to destroy all copies of the Program.

4. NO WARRANTY: THE PROGRAM IS PROVIDED TO YOU FREE OF 
CHARGE AND FOR NO CONSIDERATION AND APTITUNE DISCLAIMS ALL 
WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT 
LIMITATION, ANY WARRANTIES AS TO THE SUITABILITY OF THE 
PROGRAM FOR YOUR PURPOSES, MERCHANTABILITY, OR FITNESS FOR A 
PARTICULAR PURPOSE. IN NO EVENT SHALL APTITUNE BE LIABLE FOR 
ANY DAMAGES WHATSOEVER, INCLUDING LOSS OF ANTICIPATED 
PROFITS, OR ANY DIRECT, INCIDENTAL, EXEMPLARY, SPECIAL, OR 
CONSEQUENTIAL DAMAGES. THE PROGRAM IS PROVIDED TO YOU "AS IS,
WHERE IS", AND WITH ALL FAULTS AND WITHOUT ANY WARRANTIES OF 
ANY KIND.

5. INDEMNIFICATION BY LICENSEE: You agree to indemnify 
Aptitune from, and hold Aptitune harmless against, any claim 
or action by any third party arising out of or related to your
operation or use of the Program, provided that such 
indemnification shall not apply to any claim or action by any 
third party alleging that the Program, as supplied to you by 
Aptitune, infringes the proprietary rights of any third party.

6. CHOICE OF LAW: This license shall be governed and 
construed in accordance with the laws of the State of New 
Hampshire, without giving effect to its conflicts of laws 
principles, and the Courts of which shall have exclusive 
jurisdiction over any dispute arising hereunder

7. ACKNOWLEDGMENT: YOU ACKNOWLEDGE THAT YOU HAVE READ THIS 
AGREEMENT, UNDERSTAND IT, AND AGREE TO BE BOUND BY ITS TERMS 
AND CONDITIONS. YOU ALSO AGREE THAT THIS AGREEMENT IS THE 
COMPLETE AND EXCLUSIVE STATEMENT OF AGREEMENT BETWEEN THE 
PARTIES AND SUPERSEDES ALL PRIOR PROPOSALS, AGREEMENTS, OR 
UNDERSTANDINGS, WRITTEN OR ORAL, WITH RESPECT TO THE SUBJECT 
MATTER OF THIS AGREEMENT.

Should you have any questions concerning this Agreement, 
please contact in writing Aptitune Corporation, PO Box 1033, 
Plaistow NH 03865 USA

Here is freemem. For MSIE, use the right mouse button to click on this link - freemem.tar (30720 bytes) and select "Save Target As". For other browsers, check the documentation. If you're FTPing this file and there's a PC involved, be sure that the PC know that this file is binary and not text.

Interpreting freemem's output
Here are descriptions of the parameters reported by freemem:

Signs of memory pressure (in increasing order):

  1. The value of freemem is frequently less than lotsfree
  2. The value of gpgslim is frequently greater than desfree
  3. The value of freemem is frequently less than gpgslim
  4. The value of freemem is frequently less than desfree
  5. The value of freemem is frequently less than minfree

Signs that the system has sufficient memory:

  1. The value of freemem is usually above lotsfree
  2. The value of gpgslim never changes and is always equal to desfree

How to graph freemem's output with gnuplot
gnuplot will use the following script will graph the output of freemem:

set terminal png medium #default 
set output "/tmp/freemem.png" 
set title "Free memory on 06/04/2002" "Times-Roman" 
set xtics rotate 
set yrange [ 0 : 4000 ] 
set ylabel "pages of memory"
set xlabel " " 
set xdata time 
set timefmt "%H:%M:%S" 
set format x "%H:%M" 
set size 0.75,0.75 
plot "/tmp/fmdata2" using 1:($3) title "freemem" with linespoint 3 ,\
"/tmp/fmdata2" using 1:($7) title "lotsfree" with linespoint 1 ,\
"/tmp/fmdata2" using 1:($5) title "gpgslim" with linespoint 1 
reset 

Here is the graph produced by gnuplot and it shows that the value of freemem is frequently less than lotsfree, the value of gpgslim is frequently greater than desfree, and the value of freemem is frequently less than gpgslim. The first three conditions to establish the presence of memory pressure have been met. By 10:30, the memory pressure on this system had subsided, and this is apparent because freemem generally stayed above the value of lotsfree and gpgslim always equalled the value of desfree.

Memory pressure can also be confirmed by looking at the size of the dynamic buffer cache. In a graph created with a very similar script, it is apparent that the value of bufpages does not increase beyond that of dbcminpgs until the memory pressure drops. The degree to which bufpages strays from the value of dbcminpgs is determined by memory pressure and the fact that the bufpages line is very flat is typical of systems which do not use the buffer cache heavily.

We hope that you'll find freemem to be a useful tool and we encourage you to distribute it throughout the HP-UX community. And of course, feel free to request an evaluation copy of SarCheck for HP-UX.


Go to the SarCheck home page

Copyright © 1996-2004 Aptitune Corporation, All rights reserved.
Information in this document is subject to change without notice.
Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.
This information is correct as of December 3, 2004.