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
Investigate pantsd memory usage increases more than expected #7647
Comments
I was using python memory_profiler module (https://github.com/pythonprofilers/memory_profiler or https://pypi.org/project/memory-profiler/ ) to profile pantsd's memory usage for running following command 10 times:
The memory usage after the first run was Here is a list of method calls that potentially increases the memory usage in each run:
(+ 2.5MB):
(+ 0.3MB):
(+ 0.8MB):
Based on a chain of method calls above, it seems like |
I was also using Python objgrap (https://mg.pov.lt/objgraph/objgraph.html) to generate the objects graphs. We could see number of new objects (grouped by data type) increase:
|
A ticket that is definitely contributing to this memory usage (although it's not clear how much yet) is: #6555. |
In the randomized objgraph sample, we also see #5668: ...ie, "all of the Targets in a BuildGraph reference the buildgraph". @illicitonion mentioned that he had seen indication that modern python 3 does support breaking reference cycles that pass through built-in collections. |
Two branches were forked from pantsd-sans-forking branch:
|
As a result of #7596, we see pantsd’s memory usage increases in each run (of the same command), and reaches 55% more memory usage after 10 runs.
The text was updated successfully, but these errors were encountered: