-
Notifications
You must be signed in to change notification settings - Fork 34
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
[BUG] Memory leaks inside RCPs #413
Comments
Thanks for reporting the issue. That reminds me of #63 |
Just another small remark, I think we should not abuse 4C/src/structure_new/src/utils/4C_structure_new_dbc.cpp Lines 99 to 108 in 0c76853
|
FYI, I have been trying to reduce the number of RCPs/shared_ptrs inside 4C for precisely this reason. And fully agree on the ParameterList thing. It's really meant for input and should not be used as dynamic container to make bad inheritance work, see #61. |
Actually, the code example above is exactly a typical example that creates a cyclic dependency, we need just to a few more lines above to recognize it: 4C/src/structure_new/src/utils/4C_structure_new_dbc.cpp Lines 94 to 109 in 0c76853
timint_ptr_ is a shared pointer inside Solid::Dbc , it contains the ParametersList , to which we ultimately store the RCP to the this object itself.
|
Description
There are memory leaks in the new structure solver. The debug version of Trilinos clearly reveals it, see the attached log file. valgrind also detects them, see another log.
I looked at those location indicated by Trilinos, and it seems the leaks are related for those objects which get added to a shared
ParametersList
in multiple places. At least, the pattern preceding the appearances of this leaks is always the same: something gets plugged into an arbitrary branch of a large params list. I assume, there is a cycle dependency appearing somewhere. I could not identify the source of the problem with a glance look at the code since the hierarchy between the shared pointers is actually quite complicated + a lot of objects behaving like global variables. I can try to debug it a bit further.valgrind.log
4c-log.txt
Steps to reproduce
The text was updated successfully, but these errors were encountered: