Formula for converting memory pages to gigabytes

vmstat in AIX returns memory statistics in 4096 byte blocks. To convert this to gigabytes:

number of blocks / 256 / 1024

3 thoughts on “Formula for converting memory pages to gigabytes

  1. a handy lil function to stick in your .profile relating to memory math fun in aix:

    [1140][nbaxa214]:/home/jeffq> lsmem
    total real memory = 120.00 GB
    real memory free = 20.60 GB
    paging space used = 0.41 GB
    real memory used = 99.40 GB
    client pages used = 20.70 GB
    [1141][nbaxa214]:/home/jeffq> declare -f lsmem
    lsmem ()
    sudo svmon -G | awk ‘
    /memory/ {printf(“total real memory =\t %5.2f GB\n”,$2/256/1024)}
    /memory/ {printf(“real memory free =\t %5.2f GB\n”,$4/256/1024)}
    /in use/ {printf(“real memory used =\t %5.2f GB\n”,($3+$5)/256/1024)}
    /pg space/ {printf(“paging space used =\t %5.2f GB\n”,$4/256/1024)}’;
    vmstat -v | awk ‘
    /client pages/ {printf(“client pages used =\t %5.2f GB\n”,$1/256/1024)}’

    what i’d like to know how to do is get a good view of shared memory on a system without using a very costly svmon query. i haven’t quite figured out how to get it out of ipcs with multiple instances of databases.

  2. I don’t know. I would suspect that your answer would lie with nmon / topas or the famous (at least in the world of AIX) Nigel that everyone talks about. I know that topas now has some cool features the consolidate information from different lpars on the same box and little tools like nmon,topas or sar always seem better than the big graphical solutions that management falls in love with. These things just aren’t flexible enough, they often are too unix agnostic, and aren’t as fun as what you can do yourself with ksh, ssh, and php.

  3. Sorry it took me so long, I just discovered WordPress’s spam filter, it is a little tricky to find if you spend 99.99% of your time doing something other than looking for it. 😉

Leave a Reply

Your email address will not be published. Required fields are marked *