-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Add a configurable cap on total pantsd memory usage. #10003
Add a configurable cap on total pantsd memory usage. #10003
Conversation
# Delete this line to force CI to run Clippy and the Rust tests. [ci skip-rust-tests] # Delete this line to force CI to run the JVM tests. [ci skip-jvm-tests]
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.
Good idea.
@@ -399,6 +399,22 @@ def test_pantsd_memory_usage(self): | |||
), | |||
) | |||
|
|||
def test_pantsd_max_memory_usage(self): |
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.
Will probably want to sanity check that test_pantsd_memory_usage
is still relevant. I know they do different things, but possible bit rot not. NB that we skip it due to flakiness.
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.
It is still relevant (see the comments on the ticket linked in the description of this PR), but I have not been able to follow up on re-enabling it.
Co-authored-by: Eric Arellano <[email protected]>
### Problem The default max memory usage from #10003 was chosen with larger monorepos in mind, and didn't match the expectation of consumers in smaller repos. ### Solution Very large repos will have folks who are able/willing to adjust limits like this to optimize for their repo size, so adjust the default down in favor of having good defaults. This relates to #7675, but it isn't the time to dive in there. ### Result Fixes #10264. [ci skip-rust-tests]
Problem
pantsd
does not implement garbage collection of theGraph
(see #7675), but additionally, there are likely a few Python-level reference cycles beyond those that we have already discovered.Solution
We will eventually implement #7675, and it will need a config value to control how much it collects. But in the meantime, having a configurable built-in cap on total memory usage is generally useful, and can consume the same flag that our eventual collection will.
Result
pantsd
will restart itself when it uses more than the configured amount of memory (defaulting to 4GB). As mentioned in the test comment, until #8200 is fixed, the message rendered when we restart will not be particularly friendly, so we should likely not cherry-pick this to 1.29.x, which will not receive #8200.This is not a complete fix for #9999, but I'm going to resolve it in favor of tracking followup in #7675.
[ci skip-rust-tests]
[ci skip-jvm-tests]