-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[pydrake] Add example of memory leaks #21951
[pydrake] Add example of memory leaks #21951
Conversation
+@rpoyner-tri for feature review, please. |
9dae28f
to
5f299c1
Compare
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.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee rpoyner-tri(platform), needs at least two assigned reviewers
a discussion (no related file):
Got a bit of data. As far as I can tell "simple_source" doesn't leak or is too slow to worry about. On the other hand, "trivial_simulator" leaks about 1Mib/sec, as show in the graph:
The initial working set for both is about 300Mib, so it takes maybe 5.5 minutes for "trivial_simulator" to double the initial working set.
The above graph and the monitoring were done with apt install python3-mprof
.
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.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee rpoyner-tri(platform), needs at least two assigned reviewers
a discussion (no related file):
Previously, rpoyner-tri (Rick Poyner (rico)) wrote…
Got a bit of data. As far as I can tell "simple_source" doesn't leak or is too slow to worry about. On the other hand, "trivial_simulator" leaks about 1Mib/sec, as show in the graph:
The initial working set for both is about 300Mib, so it takes maybe 5.5 minutes for "trivial_simulator" to double the initial working set.
The above graph and the monitoring were done with
apt install python3-mprof
.
Excellent. Does that mean this reproducer is a sufficient MVP and we can merge it and keep going?
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.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: needs at least two assigned reviewers
a discussion (no related file):
Previously, jwnimmer-tri (Jeremy Nimmer) wrote…
Excellent. Does that mean this reproducer is a sufficient MVP and we can merge it and keep going?
yeah, I think we've got enough to roll.
+@ggould-tri for platform review tomorrow per schedule, please. |
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.
BTW, an idea for a future PR, if I were working with this a lot I would definitely toss a https://pypi.org/project/sparklines/ graph into the text output. The difference between logistic (e.g. finite cache), logarithmic (e.g. unbounded dict), and linear (traditional leak) would then be visually obvious.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all discussions resolved, LGTM from assignees rpoyner-tri(platform),ggould-tri(platform)
Towards #14387.
The objective of this PR is to bootstrap the virtuous cycle of making reproducers of the problem, finding good diagnostic tools to help explain the problem, fixing bugs in prototypes, re-instrumenting, adding more examples, etc.
Sample output of
bazel run //bindings/pydrake:memory_leak_test
as of today:This change is