-
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
leaf systems implemented in python are immortal #22515
Comments
Added a pretty minimal leak test at #22517. Here's the verbose output:
|
BTW I imagine the problem is the |
Good call. I'll do some experiments. |
In my experiment, |
Hm, maybe the cycle is even unnecessary -- I'll need to think of a test case to decide that. |
fixes are in development. Probably have to re-annotate all of |
What happened?
First noticed in this stack overflow question: https://stackoverflow.com/questions/79380761/potential-memory-leaks-of-diagrams-with-leaf-systems-in-pydrake/
Confirmed in test cases here: https://github.com/rpoyner-tri/drake/releases/tag/py-leaf-leak
Apparently LeafSystem subclasses implemented in Python end up using/leaking bound methods in a way that can't be garbage collected.
Version
circa v1.37.0
What operating system are you using?
Ubuntu 22.04
What installation option are you using?
compiled from source code using Bazel
Relevant log output
The text was updated successfully, but these errors were encountered: