rusage::ru_maxrss in bytes or kilobytes
rusage::ru_maxrss in bytes or kilobytes
- Subject: rusage::ru_maxrss in bytes or kilobytes
- From: Xi Wang <email@hidden>
- Date: Sun, 1 Mar 2009 19:21:55 -0500
Hi,
According to the man page on Mac OS X (and the BSD convention),
ru_maxrss of struct rusage represents `the maximum resident set size
utilized (in kilobytes)'.
$ /usr/bin/time -l uname -v
Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 2008;
root:xnu-1228.9.59~1/RELEASE_I386
0.00 real 0.00 user 0.00 sys
385024 maximum resident set size
...
However, the reported number 385024 seems to be in bytes rather than
in kilobytes, because `uname' is a simple program and unlikely to take
376 MB memory. So are the results returned by syscalls getrusage and
wait4.
Here is the code.
kern_exit.c
612 p->p_ru->ru_maxrss = tinfo.resident_size;
task.c
1205 if (flavor == TASK_BASIC2_INFO_32) {
...
1210 basic_info->resident_size = pmap_resident_max(...);
1211 } else {
1212 basic_info->resident_size = pmap_resident_count(...);
1213 }
1214 basic_info->resident_size *= PAGE_SIZE;
Should there be something like `/ 1024' ? Thanks.
- xi
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden