You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Peak memory usage measurements may be inaccurate or missing on Linux #161
Thank you for providing an independent benchmark of Python type checkers!
If I am understanding the code here correctly, you are using a (10 ms) polling strategy to measure peak RSS on Linux. This approach is prone to errors, since fast commands may not receive any measurements at all. And even for slow commands, the last 0 - 10 ms in peak RSS will be missing. Presumably, the end of the program is where most type checkers have their highest memory usage, so it would be good to include those last 10 ms.
I think you could use wait4 to get accurate peak RSS measurements on Linux, which would probably also result in a simplification of the code.
Disclaimer: I work on ty (but this issue is not about something that would affect ty in a specific way)
Good find! Feel free to put up a PR for the change along with the before-and-after benchmarks. I will fix it eventually, but happy to review a PR in the meantime.
Thank you for the prompt reply. I opened a PR with a fix in #165. The results show that this isn't just a theoretical problem. Peak RSS can be ~20% higher for fast-running type checkers now.
Activity
lolpack commentedon Nov 3, 2026
Good find! Feel free to put up a PR for the change along with the before-and-after benchmarks. I will fix it eventually, but happy to review a PR in the meantime.
sharkdp commentedon Nov 3, 2026
Thank you for the prompt reply. I opened a PR with a fix in #165. The results show that this isn't just a theoretical problem. Peak RSS can be ~20% higher for fast-running type checkers now.