Issue 30513: getrusage returns platform-dependent value (original) (raw)
Issue30513
Created on 2017-05-30 17:01 by sam-s, last changed 2022-04-11 14:58 by admin.
Messages (2) | ||
---|---|---|
msg294768 - (view) | Author: sds (sam-s) | Date: 2017-05-30 17:01 |
`resource.getrusage(resource.RUSAGE_SELF).ru_maxrss` returns the peak memory usage, in *bytes* on BSD (including Mac OS X) and in *kilobytes* on Linux. This means that to get a cross-platform value, the user has to check `sys.platform`, which is fairly inconvenient. It would seem like a good idea to return a platform-independent value (e.g., multiply the Linux return value by 1000 - or is it 1024?!) Please see also * https://bugs.python.org/issue20468 * https://stackoverflow.com/a/7669482/850781 Thank you! | ||
msg294769 - (view) | Author: sds (sam-s) | Date: 2017-05-30 17:16 |
Experiment shows that the Linux multiplier is 1024 (not 1000). |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:47 | admin | set | github: 74698 |
2017-05-30 17:16:22 | sam-s | set | messages: + |
2017-05-30 17:01:19 | sam-s | create |