This repository was archived by the owner on Sep 30, 2024. It is now read-only.
feat/internal/memcmd: add internal/memcmd package to allow for memory tracking of exec.Cmd processes#62803
Merged
ggilmore merged 3 commits intoJun 10, 2024
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
454ea2d to
3200fec
Compare
6e01906 to
5477d17
Compare
8c7c2c8 to
fa9f739
Compare
f34c905 to
7836694
Compare
7836694 to
3e3654d
Compare
Strum355
reviewed
Jun 7, 2024
c5f3b77 to
182220b
Compare
eseliger
approved these changes
Jun 10, 2024
eseliger
left a comment
Member
There was a problem hiding this comment.
LGTM pending the bazel question from Noah and an approving review from the dev-infra team who own bazel
eseliger
reviewed
Jun 10, 2024
mmanela
reviewed
Jun 10, 2024
182220b to
5f49f48
Compare
456f90e to
a223c9a
Compare
Strum355
approved these changes
Jun 10, 2024
Co-authored-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>
a223c9a to
9dd391b
Compare
2044667 to
ea401d0
Compare
Contributor
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 PR adds a new package memcmd, that adds a new abstraction called "Observer" that allows you to track the memory that a command (and all of its children) is using. (This package uses a polling approach with procfs, since maxRSS on Linux is otherwise unreliable for our purposes).
Example usage
Test plan
Unit tests
Note that some tests only work on darwin, so you'll have to run those locally.
Changelog
This feature adds a package that allows us to track the memory usage of commands invoked via exec.Cmd.