• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getrusage only partially working?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: getrusage only partially working?
      • From: Mike Fischer <email@hidden>
References: 
 >getrusage only partially working? (From: Mike Fischer <email@hidden>)

  • Prev by Date: Re: rusage data for another process?
  • Next by Date: Re: getrusage only partially working?
  • Previous by thread: getrusage only partially working?
  • Next by thread: Re: getrusage only partially working?
  • Index(es):
    • Date
    • Thread