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

Fix qcdb memory leak #2349

Merged
merged 1 commit into from
Nov 12, 2021
Merged

Fix qcdb memory leak #2349

merged 1 commit into from
Nov 12, 2021

Conversation

JonathonMisiewicz
Copy link
Contributor

Description

This PR fixes a memory leak that was occurring in the Python-side qcdb code. The code meant to modify a class variable but was actually creating and modifying an instance variable. Initialization happened many more times than needed, and some memory was not being cleared upon object deletion.

The only explanation I have for how this produced a memory leak is that having a class variable and an instance variable with the same name confused the Python garbage collector. I was able to confirm object creation and deletion was occurring roughly as expected.

Checklist

  • Confirmed this change reduces the memory footprint for repeated SCF calls

Status

  • Ready for review
  • Ready for merge

@JonathonMisiewicz JonathonMisiewicz added the efficiency For issues about code in Psi needing a disturbing amount of time and/or memory. label Nov 9, 2021
Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

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

yikes, I didn't know it was in my power to cause memory trouble. thanks!

@hokru hokru merged commit cfd68bd into master Nov 12, 2021
@JonathonMisiewicz JonathonMisiewicz deleted the JonathonMisiewicz-patch-1 branch November 16, 2021 17:00
@JonathonMisiewicz JonathonMisiewicz added this to the Psi4 1.5 milestone Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
efficiency For issues about code in Psi needing a disturbing amount of time and/or memory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants