Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: bremner@cs.mcgill.ca (David BREMNER)
Subject: getrusage on DEC OSF1 V1.3
Date: 21 Dec 1994 17:45:38 GMT	[thread overview]
Message-ID: <3d9pk2$e8l@homer.cs.mcgill.ca> (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   



             reply	other threads:[~1994-12-21 17:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-12-21 17:45 David BREMNER [this message]
1994-12-21 18:44 ` getrusage on DEC OSF1 V1.3 Jeffrey Mogul
1995-01-02 22:46   ` Andreas Stolcke
1995-01-04  2:55     ` Jeffrey Mogul
read-only archive

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