return memory.peak after calling sandboxed commands#115
Merged
GuillaumeGomez merged 1 commit intorust-lang:mainfrom Feb 11, 2026
Merged
return memory.peak after calling sandboxed commands#115GuillaumeGomez merged 1 commit intorust-lang:mainfrom
GuillaumeGomez merged 1 commit intorust-lang:mainfrom
Conversation
c143059 to
d83b6cd
Compare
Member
Author
|
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 |
Member
There was a problem hiding this comment.
So you want to read current process memory info?
Member
Author
There was a problem hiding this comment.
no, the cgroup tracks the memory peak over the whole lifetime of the container.
For all things happening inside that group / container
Member
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
I'll take that and do some more detailed testing before I release.
GuillaumeGomez
approved these changes
Feb 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.