From: Harald Finster <finster@ave.ac.agit.de>
Subject: getrusage returns zeros
Date: Fri, 08 Sep 2000 09:20:47 +0200 [thread overview]
Message-ID: <39B8934E.DF91A0E3@ave.ac.agit.de> (raw)
Hello,
the following seems to be a FAQ, but (I have been searching with deja)
a NAQ (Never Answered Question :-)
I try to track down a memory leak problem using 'getrusage',
which seems to be executed correctly (no error returned).
The following sample program:
=== BEGIN testgetrusage.cpp ===
#include <sys/resource.h>
#include <iostream>
int main() {
struct rusage u;
cerr << "rusage-state = " << getrusage ( RUSAGE_SELF, &u) << endl;
cerr << "ru_ixrss = " << u.ru_ixrss << endl;
cerr << "ru_idrss = " << u.ru_idrss << endl;
cerr << "ru_isrss = " << u.ru_isrss << endl;
return 0;
}
=== END testgetrusage.cpp ===
compiled with
cxx testgetrusage.cpp -o testgetrusage
results in the following output:
rusage-state = 0
ru_ixrss = 0
ru_idrss = 0
ru_isrss = 0
Looks like a very efficient (zero memory consuming) program :-)
The OS is Digital UNIX V4.0F (Rev. 1229); Wed Nov 10 10:56:11 GMT 1999
The compiler is Compaq C++ V6.2-024 for Digital UNIX V4.0F (Rev. 1229)
Thanks a lot for any hint
Harald
--
Harald Finster
-
Windoze can be used on the North-Pole without any problems,
... because a frozen computer can't freeze
reply other threads:[~2000-09-08 7:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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