From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5a417d13a938d0fb,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-12-21 09:45:38 PST Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!europa.eng.gtefsd.com!news.mathworks.com!newshost.marcam.com!uunet!newsflash.concordia.ca!news.mcgill.ca!homer.cs.mcgill.ca!bremner From: bremner@cs.mcgill.ca (David BREMNER) Newsgroups: comp.unix.osf.osf1 Subject: getrusage on DEC OSF1 V1.3 Date: 21 Dec 1994 17:45:38 GMT Organization: Computational Geometry Laboratory, McGill University Distribution: world Message-ID: <3d9pk2$e8l@homer.cs.mcgill.ca> NNTP-Posting-Host: bambam.cs.mcgill.ca Summary: ru_maxrss always 0 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 #include #include #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