[Orca-users] procallator... was Strange Configuration Error

Blair Zajac blair at orcaware.com
Mon Jun 28 21:31:50 PDT 2004


Yaple, James A. wrote:

> We're just starting to use the procallator.pl script on our Linux
> rollout....
> 
> Based on examination, how can the numeric amount of free memory be
> determined?  I get the percentages, but do I need to calculate the memory
> amount, or is it in another column?  Here is a snippet of the procallator
> data:
> 
> mem_used%	mem_free%	mem_shrd%	mem_buff%	mem_cchd%
> swp_free%	swp_used%
> 62.13	       37.87	0	       11.57	32.33	       100
> 0

It looks like this piece of code does that:
    # Get memory ocupation
    open (F_MEMINFO, "<$PROC/meminfo");
    <F_MEMINFO>;
    ($dumb, $mem_total,$mem_used,$mem_free,$mem_shrd,$mem_buff,$mem_cchd)=split 
/[^0-9]+/,<F_MEMINFO>;

So basically, just take a look at the second line of /proc/meminfo.  Now where 
does the kernel get that number from, that's another question :)

Blair

-- 
Blair Zajac <blair at orcaware.com>
Plots of your system's performance - http://www.orcaware.com/orca/



More information about the Orca-users mailing list