What's the unit of `ru_maxrss` on Linux?

后端 未结 2 518
粉色の甜心
粉色の甜心 2021-01-04 03:32

This is from man getrusage

struct rusage {
    struct timeval ru_utime; /* user time used */
    struct timeval ru_stime; /* system time used */         


        
相关标签:
2条回答
  • 2021-01-04 04:26

    The man page says:

    ru_maxrss (since Linux 2.6.32)

    This is the maximum resident set size used (in kilobytes). For RUSAGE_CHILDREN, this is the resident set size of the largest child, not the maximum resident set size of the process tree.

    So, it's expressed in kilobytes, just like in BSD.

    0 讨论(0)
  • 2021-01-04 04:28

    It's not a standard field for the rusage structure so POSIX doesn't mandate anything about it. But on Linux

    ru_maxrss (since Linux 2.6.32)

    This is the maximum resident set size used (in kilobytes). For RUSAGE_CHILDREN, this is the resident set size of the largest child, not the maximum resident set size of the process tree.

    0 讨论(0)
提交回复
热议问题