Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-132917: Use /proc/self/status for mem usage info.#133544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Using smaps_rollup is quite a lot slower and we can get the similar infofrom /proc/self/status.
bedevere-bot commentedMay 6, 2025
🤖 New build scheduled with the buildbot fleet by@nascheme for commit5b3621d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133544%2Fmerge If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
nascheme commentedMay 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Some more precise run time comparison. With the script fromGH-132917 running in 10 parallel threads, the I also tested the MacOS version and it takes 4.5 us/per call. The full GC pass is taking roughly 70 ms. |
Comparing the info from /proc/self/smaps_rollup vs /proc/self/status. This is on a Linux 6.1.0 kernel with 16 GB of RAM and 16 GB of swap. I ran a Python program that just allocates a bunch of memory in a loop while printing the proc info.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This looks like a more efficient approach and the change is pretty simple... But unless@hugovk wants to reopen the release branch I think it should just go into beta 2. (Also I still have the same concerns I mentioned before, but they're not pressing enough to worry about for b1.)
Let's keep this for b2, thanks! |
751db4e
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@nascheme for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
GH-133718 is a backport of this pull request to the3.14 branch. |
Uh oh!
There was an error while loading.Please reload this page.
Using smaps_rollup is slower and we can get the similar info from /proc/self/status. We don't need the extra accuracy that smaps_rollup is giving.
Profiling is showing that reading the
smaps_rollup
file is taking on the order of 30 ms. Readingstatus
is much faster. Some background detail on this difference:https://gitlab.com/gitlab-com/gl-infra/production-engineering/-/issues/10966#note_410194443