-
Notifications
You must be signed in to change notification settings - Fork 44
return memory.peak after calling sandboxed commands #115
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c143059 to
d83b6cd
Compare
|
I know it's a long time ago, @emilyalbini @Nemo157 does one of you have any insight? From my high level docker knowledge this should be fine? |
This comment was marked as outdated.
This comment was marked as outdated.
d83b6cd to
fcf6867
Compare
fcf6867 to
35f5db7
Compare
| /// Tries cgroups v2 first, then falls back to cgroups v1. | ||
| fn read_memory_peak(&self) -> Option<u64> { | ||
| let paths = [ | ||
| "/sys/fs/cgroup/memory.peak", // v2 |
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.
So you want to read current process memory 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.
no, the cgroup tracks the memory peak over the whole lifetime of the container.
For all things happening inside that group / container
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.
Sounds extremely strange and likely not doing what you would expect but I'm not 100% sure as docs for it is quite bad (in linux man pages). So let's go with it.
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.
I'll take that and do some more detailed testing before I release.
This is related to rust-lang/docs.rs#878 (and rust-lang/docs.rs#842), where we want to get the memory usage of the build and store it.
We will already have the
CommandErrorkind after rust-lang/docs.rs#3201, we show build durations since rust-lang/docs.rs#3172, now the only thing missing is memory usage.I imagine this could also be useful for crater etc.
I'm not a docker pro, so I'm not 100% certain if all of this is fine. The test seem to pass without issue.