calculating proportion of memory that a program is actively using

calculating proportion of memory that a program is actively using

Post by David Fernandez Vi~uale » Fri, 17 Apr 1998 04:00:00



Hi

Quote:> Can someone tell me if there is a way of listing the proportion of available
> memory that programs are actively using? For example: A list which shows that
> an Oracle database is using xMeg of memory, whilst another program is using
> yMeg etc.. I have looked at VMSTAT, SAR and IOSTAT, none of these give me
> what I am looking for. Alternatively is there a program similar to the
> MONITOR program which is only available on AIX unix, which can be used with
> Solaris? any help would be much appreciated. Thanks!

Try to get RMCmem package, it includes a lot of usefull commands wich
show the memory used for every application running in the machine, the
dinamic libraries and many more.
The package is free and you can get it from SUN web server.

ttp://www.sun.com/sunworldonline/swol-03-1998/swol-03-perf.html

Un Saludo....David

    ===========================================



           Banco Espa~ol de Credito
          Gerencia de Comunicaciones
              Tel: 91-3383578

    ===========================================

 
 
 

calculating proportion of memory that a program is actively using

Post by Rob » Fri, 17 Apr 1998 04:00:00



> Can someone tell me if there is a way of listing the proportion of available
> memory that programs are actively using? For example: A list which shows that
> an Oracle database is using xMeg of memory, whilst another program is using
> yMeg etc..

Try top...

--
Rob :-)}

 
 
 

calculating proportion of memory that a program is actively using

Post by how.. » Fri, 17 Apr 1998 04:00:00



> Try top...

Top works great on my SunOS boxes,
but I'm a bit dubious on the versions for Solaris.
 
 
 

calculating proportion of memory that a program is actively using

Post by Casper H.S. Dik - Network Security Engine » Fri, 17 Apr 1998 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]



>> Try top...
>Top works great on my SunOS boxes,
>but I'm a bit dubious on the versions for Solaris.

Why?  Works fine for me.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. Calculating memory used by a program

I am interested to compute the total memory used by a program.
I tried to use the getrusage function, but had some problems.

The man page for getrusage says :

  The getrusage subroutine returns information describing the
  resources utilized by the current process, or  all its terminated
  child processes.

However, the resources seem to be the same even after I allocate 1 MB
dynamically. What am I doing wrong in calculating the memory resource
used by my program? My program and the output follow.
Also, is there a function other than getrusage that can be used for this
purpose?

 Raghu V. Hudli
 IBM Corp.
===========================================================================
Disclaimer: The opinions expressed in this note are my own and do not
necessarily reflect those of my employer

===============================   program =================================

#include <sys/resource.h>

void dumprusage();
main(){
        int i;
        int *j;

        printf("i ? ");
        scanf("%d",&i);
        printf("resources before memory allocation\n");
        dumprusage();
        j = malloc(i*1024);
        printf("resources after memory allocation\n");
        dumprusage();

void dumprusage() {

        int who = RUSAGE_SELF;
        struct rusage Rusage;

       getrusage(who,&Rusage);

       printf("ru_utime %d\n",Rusage.ru_utime.tv_usec);
       printf("ru_stime %d\n",Rusage.ru_stime.tv_usec);

       printf("ru_maxrss %d\n",Rusage.ru_maxrss);
       printf("ru_ixrss %d\n",Rusage.ru_ixrss);
       printf("ru_idrss %d\n",Rusage.ru_idrss);
       printf("ru_isrss %d\n",Rusage.ru_isrss);

       printf("inputs %d\n",Rusage.ru_inblock);
       printf("outputs %d\n",Rusage.ru_oublock);

===============================   output  =================================

i ? 1024
resources before memory allocation
ru_utime 90000
ru_stime 160000
ru_maxrss 59
ru_ixrss 360
ru_idrss 156
ru_isrss 0
inputs 0
outputs 0
resources after memory allocation
ru_utime 90000
ru_stime 160000
ru_maxrss 59
ru_ixrss 360
ru_idrss 156
ru_isrss 0
inputs 0
outputs 0

2. SMS alert at root login

3. how to assess what is using various proportions of memory

4. Zooed Slackware

5. How to calculate Used Memory???

6. SCO 3.2v4.2 & MMX Machines.

7. How much memory am i using ?

8. redhat 4.1 install problem: mount failed

9. How do I get into the setup program when I am using Tom's Rboot?

10. How to see memory used per user; memory used per process

11. calculating the memory footprint of an application

12. C pgm to calculate memory

13. Calculating memory Usage