-
Notifications
You must be signed in to change notification settings - Fork 234
Memory consumption gradually grows when Operator called in loop #845
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
Comments
Is the issue creating an operator or are you creating new solver? |
the issue is creating new symbolic objects |
Didn't realize I haven't posted it there. There is a small issue wit h if you call |
not sure if related to I have a reproducer here |
Isn't this fixed byt the clear_cache fix? I k ow #945 is referenced here but I don't think it's the same issue |
Why is it not the same issue? |
Sorry read through it again and the title/description is quite missleading as it says that doing |
It doesn't? |
With the new caching infrastructure it doesn't no, that's why I removed all the clear cache and preallocation of |
I think it is still an issue. Every time new symbolic objects are created, a new class type is dynamically created ; that is what causes the memory increase (not the data), as apparently this dynamically created class cannot be eliminated from the python session. solver.op() called in a loop thousands of times creates thousand of new It is also possible I'm missing something at this point... what I encourage to do is to take my MFE linked above and trying it again |
I would like to make a comment on this issue. Motived by discussion in the thread https://devitocodes.slack.com/archives/C1HSXP6KB/p1643619000223249 I performed several 3D experiments. In a first test (
I modeled 20 shots in a loop using the In a second experiment (
I passed a
You can run the tests with a simple command, i.e Having thinked a little I came to realize that the creation of
At certain point I considered the possibility of the |
Bug relates to known python bug: ChatGPT summary: While the problem has been identified and discussed in detail, the consensus among the participants, including some Python core developers, is that fixing it would be complex, possibly leading to a change in public C APIs or introducing slower lookups. Additionally, the idea of adding a new 'unlink' method was not widely accepted. The key takeaways from the discussion include:
In conclusion, while the circular reference in class creation is recognized, the decision was made not to pursue a fix due to the complexity of the problem, the potential performance impact, and the risk of exposing implementation details. Users experiencing specific issues related to this behavior may need to consider custom solutions tailored to their particular needs and constraints. |
More discussion on Stackoverflow: |
In current master, there are a few sources of increased memory consumption when operators are created in a loop through the seismic wrapper classes:
The text was updated successfully, but these errors were encountered: