Re: getrusage only partially working?
Re: getrusage only partially working?
- Subject: Re: getrusage only partially working?
- From: Terry Lambert <email@hidden>
- Date: Tue, 11 Dec 2007 18:27:34 -0800
On Dec 11, 2007, at 7:26 AM, Mike Fischer wrote:
Hi!
For some reason I can't seem to get getrusage(2) to work the way I
expect it to under 10.4.11 on a PPC G5 machine (haven't tested on
other machines).
I expected the memory related fields to show values other than 0
which more or less correlate with the actual memory usage of the
application. But what I am seeing is values of 0 only in each of
these fields (ru_maxrss, ru_ixrss, ru_idrss, ru_isrss).
Probably I'm doing something wrong, but what?
Most of the information you are requesting in Mac information, and you
are requesting it using a BSD API.
The BSD API idea of the information will not be updated until the
process exits (see xnu/bsd/kern/kern_exit.c:proc_exit()).
If you want this information while the process is running, you're
going to need link against the whole kernel and use unsupported APIs.
Needless to say, this will end up being rather expensive, which is why
we don't export them via BSD in the first place.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden