Skip to content

Conversation

@LKFEIYI
Copy link

@LKFEIYI LKFEIYI commented Jan 6, 2026

Apologies for the previous PR #6832 (comment), which mixed bug fixes and refactoring. The refactoring was performed during the investigation of a memory leak issue #6794 (comment). Now the PR #6832 (comment) was divided into fix and refactor.

The previous memory leak was caused by induced_rho not being deleted in source/source_estate/module_pot/efield.cpp.

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #...

Unit Tests and/or Case Tests for my changes

  • A unit test is added for each new feature or bug fix.

What's changed?

  • Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

Remove dynamically allocated array for induced_rho to prevent memory leak
Copy link
Collaborator

@mohanchen mohanchen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@mohanchen mohanchen added Refactor Refactor ABACUS codes Bugs Bugs that only solvable with sufficient knowledge of DFT labels Jan 7, 2026
@mohanchen
Copy link
Collaborator

Thanks for your contribution!

@mohanchen mohanchen merged commit 427105d into deepmodeling:develop Jan 7, 2026
14 checks passed
@LKFEIYI LKFEIYI deleted the patch-2 branch January 9, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants