Skip to content
Discussion options

You must be logged in to vote

It comes from

let success = getrusage(RUSAGE_CHILDREN, &mut buf);

    // Linux and *BSD return the value in KibiBytes, Darwin flavors in bytes
    let max_rss_byte = if cfg!(target_os = "macos") || cfg!(target_os = "ios") {
        result.ru_maxrss
    } else {
        result.ru_maxrss * 1024
    };

The result is from libc::getrusage which calls Linux getrusage.

The result has structure

   struct rusage {
       struct timeval ru_utime; /* user CPU time used */
       struct timeval ru_stime; /* system CPU time used */
       long   ru_maxrss;        /* maximum resident set size */
       long   ru_ixrss;         /* in…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jtmoon79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant