Measuring memory footprint in C/C++ code on FreeBSD

Daniel O'Connor doconnor at
Thu Oct 20 22:34:25 UTC 2011

On 21/10/2011, at 4:27, Razmig K wrote:
>    I think that it would be difficult to achieve the task in a platform-transparent manner, that's why I'll be using /proc/<pid>/status on Linux, and do something else on FreeBSD.
>    I was adviced to have a look on getrusage, which I did, but I found descriptions of certain fields of struct rusage in the manpage too cryptic to make a proper use of the call.
>    Could someone please point me in the right direction?

getrusage should be portable and the man page (at least on FreeBSD) explains each of the fields.

Daniel O'Connor software and network engineer
for Genesis Software -
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

More information about the freebsd-hackers mailing list