Skip to content
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

ADI: probably memory leak in ADI_UpdateStates #1913

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Dec 3, 2023

This is ready to merge.

Feature or improvement description
The ADI_UpdateStates routine makes a copy of the AD_Input, but never destroyed that data after usage. This could lead to memory continuously getting allocated during a simulation with either ADI_C_Binding or the AD driver.

Related issue, if one exists
This issue was reported by e-mail.

Impacted areas of the software

  • AeroDyn driver
  • AeroDyn_Inflow_C_Binding library interface (for C-code coupling)

Additional supporting information

Test results, if applicable

@andrew-platt andrew-platt added this to the v3.5.2 milestone Dec 3, 2023
@andrew-platt andrew-platt self-assigned this Dec 3, 2023
The ADI_UpdateStates routine makes a copy of the AD_Input, but never destroyed that data after usage.  This could lead to memory continously getting allocated during a simulation with either ADI_C_Binding or the AD driver.
Copy link
Collaborator

@deslaughter deslaughter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Destroying the input at the end of ADI_UpdateStates gets rid of most of the memory leaks as checked with valgrind. The following needs to be added at line 760 of fVW.f90 to get rid of the other memory leaks: call FVW_DestroyInput(uInterp, ErrStat2, ErrMsg2); if(Failed()) return

@andrew-platt
Copy link
Collaborator Author

Destroying the input at the end of ADI_UpdateStates gets rid of most of the memory leaks as checked with valgrind. The following needs to be added at line 760 of fVW.f90 to get rid of the other memory leaks: call FVW_DestroyInput(uInterp, ErrStat2, ErrMsg2); if(Failed()) return

Done! Thanks for checking this!

@andrew-platt andrew-platt merged commit f168eb4 into OpenFAST:rc-3.5.2 Dec 4, 2023
@andrew-platt andrew-platt mentioned this pull request Dec 19, 2023
19 tasks
@andrew-platt andrew-platt deleted the b/ADI_MemLeak branch January 9, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants