Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!decwrl!tp From: tp@decwrl.dec.com (t patterson) Newsgroups: comp.unix.ultrix Subject: Re: how do I show amount of memory? Message-ID: <17@gilroy.dec.com> Date: 4 Jun 89 00:39:07 GMT References: <156@wbcs.UUCP> Distribution: usa Organization: DEC Western Research Lab Lines: 43 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