[SUMMARY] Figuring out the amount of physical memory

From: Hakim, Shlomo <shlomo_hakim_at_icomverse.com>
Date: Tue, 01 Sep 1998 12:31:03 +0300

Hi,

I got a bundle of answers for my question, most of which had to do with
"uerf -R" and then grep-ing for one string or another. Some of you suggested
to grep the /var/adm/messages file for the same info.

The ones I really liked were the following:

Trevor Parry gave me the "vmstat -P" which gives a very nice summary of the
physical memory usage. The "-P" option is not specified in the vmstat(1) man
page which is a petty.

Richard Bemrose contributed the following piece of code:

-- cut --
/* Returns the amount of physical memory
 * Specific to Digital UNIX (OSF1)
 * Aurthor: Richard Bemrose <rb237_at_phy.cam.ac.uk>
 * Date : 31/08/1998
 * Address: Polymers and Colloids Group, Cavendish Laboratory
            University of Cambridge, Cambridge, CB3 0HE, UK
*/

#include <stdio.h>
#include <sys/sysinfo.h>
#include <machine/hal_sysinfo.h>
#include <sys/utsname.h>

void main(int argc, char **argv)
    {
    int memsize;
    struct utsname arch;

    uname(&arch);
    getsysinfo(GSI_PHYSMEM, &memsize, sizeof(memsize), NULL, NULL);
    printf("%s has %d Mb of physical memory\n", arch.nodename,
             memsize/1024);
    }
-- cut --

This is exactly what I was looking for since I want to get the information
within a script rather than just look at it myself.

Thank you all,
Shlomo.
-----Original Message-----
From: Hakim, Shlomo [mailto:shlomo_hakim_at_icomverse.com]
Sent: Sunday, August 30, 1998 10:47
To: 'Alpha OSF Managers'
Cc: Garfinkel, Yair
Subject: Figuring out the amount of physical memory


Dear Gurus,

Does anyone know a way to figure out the amount of physical memory in a
DU4.0x machine while it is running. All mean are Kosher i.e. shell command
or system call.

Thanks,
Shlomo.
Received on Tue Sep 01 1998 - 09:30:29 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT