[comp.unix.ultrix] how do I show amount of memory?

doug@wbcs.UUCP (Doug Kratky) (06/02/89)

Is there a command in ULTRIX that will show the amount of
physical memory installed on a system?

-- 
... US MAIL ....................... UUCP ...................................
Boeing Computer Services	...!scubed!ncr-sd!ncrwic!wbcs!doug
PO Box 7730, MS K79-32		...!bellcore!fenix!ncrlnk!ncrwic!wbcs!doug
Wichita, KS 67277-7730		...!hplabs!hp-sdd!ncr-sd!ncrwic!wbcs!doug

dbb@riscy.dec.com (David Barrett) (06/03/89)

In article <156@wbcs.UUCP>, doug@wbcs.UUCP (Doug Kratky) writes:

> Is there a command in ULTRIX that will show the amount of
> physical memory installed on a system?

The uerf(8) command displays a report of ongoing system events, including system startup
information, which just happens to include the physical memory installed in the system 
("real mem").  This display is typically quite long and prints to stdout, so piping it through 
"more" is a good idea. 


----------------------------------
David Barrett		 		UUCP:	...!decwrl!riscy.dec.com!dbb
Digital Equipment Corporation
New York ULTRIX Resource Center		INET:	dbb@riscy.dec.com

These opinions are mine, all mine!!!  Digital may or may not wish to agree...

tp@decwrl.dec.com (t patterson) (06/04/89)

In article <156@wbcs.UUCP> doug@wbcs.UUCP (Doug Kratky) writes:
>
>Is there a command in ULTRIX that will show the amount of
>physical memory installed on a system?

this should work:   (result of "cat ~/bin/showmem")

#!/bin/sh
#    show amount of memory on machine in kilobytes
machine=vax
[ -f /bin/machine ] && {
	machine=`/bin/machine`
}
x=`echo "&physmem/D ; quit " | dbx -k /vmunix /dev/mem | tail -1 |\
	 awk '{print  $2}'`
case "${machine}" in
    vax)
	# a little bit of round-off error will creep in...
	echo `expr $x /  2` " K"
	;;
    mips)
	echo `expr $x \* 4` " K"
	;;
    *)
	exit 1
	;;
esac
exit 0


essentially this amounts to:  poke through memory for the value "physmem"
   and print it; on a VAX, this variable is the number of 512byte pages, on a
   PMAX, it lists the number of 4K pages.

   this is one situation where a VAX may be faster than a PMAX; on the
VAX you could use "adb" instead of "dbx" and not have to read in & filter
out so much crud.
    it's also much, much faster if you do it in C (but worth the effort?).

--
t. patterson            domain: tp@decwrl.dec.com    path: decwrl!tp
DEC Western             enet:   decwrl::tp
Software Lab            icbm:   122 9 41 W / 37 26 35 N

dan@asihub.UUCP (Dan O'Neill) (06/05/89)

To display amount of physical memory:

	uerf -R | more
	/STARTUP		(searh for string "STARTUP")

	Under the header "MESSAGE", the 3rd and 4th line display the
	amount of physical memory.

To display amount of virtual memory:

	/etc/pstat -s


-- 
Dan O'Neill	dan@asihub.uucp    {uunet|ncr-sd}!asihub!dko
Automated Systems, Inc.  San Diego R&D