Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* getrusage on DEC OSF1 V1.3
@ 1994-12-21 17:45 David BREMNER
  1994-12-21 18:44 ` Jeffrey Mogul
  0 siblings, 1 reply; 4+ messages in thread
From: David BREMNER @ 1994-12-21 17:45 UTC (permalink / raw)


Can anyone clue me as to why the following program, which prints 
something reasonable on suns running SunOs 4.1.3 and SGI's running 
Irix 5.2, prints 0 on OSF1 V1.3 on a DEC AXP?

I realize the working set size is usually an estimate, but always
returning zero seems a little weak :-)

Is this a well known "feature", or am I doing something wrong?




/* Snip here */

#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

#define ARRAY_SIZE (1048576L/sizeof(int))
#define TRIALS 1000000L

main()
{
  int random();
  struct rusage rusage;

  int arr[ARRAY_SIZE];
  
  int t;
  
  for (t=0; t< TRIALS; t++)
    {
      arr[random() % ARRAY_SIZE]++;
    }
  
  
  if(getrusage(RUSAGE_SELF,&rusage)==-1)
    {
      perror("getrusage");
      exit(1);
    }
  printf("Max Working set  = %ld\n",rusage.ru_maxrss);
}



-- 

bremner@cs.mcgill.ca   



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1995-01-04  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-12-21 17:45 getrusage on DEC OSF1 V1.3 David BREMNER
1994-12-21 18:44 ` Jeffrey Mogul
1995-01-02 22:46   ` Andreas Stolcke
1995-01-04  2:55     ` Jeffrey Mogul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox