Skip to content

fix memory leak of VolAuxData on host - #691

Merged
SeverinDiederichs merged 1 commit into
apt-sim:masterfrom
SeverinDiederichs:fix_volauxdata_memleak
Aug 14, 2026
Merged

fix memory leak of VolAuxData on host#691
SeverinDiederichs merged 1 commit into
apt-sim:masterfrom
SeverinDiederichs:fix_volauxdata_memleak

Conversation

@SeverinDiederichs

Copy link
Copy Markdown
Collaborator

The volume auxiliary data was allocated as a raw pointer and never freed in InitializeSharedAdePTTransport():

  auto *auxData = new adeptint::VolAuxData[vecgeom::GeoManager::Instance().GetRegisteredVolumesCount()];

This is fixed by using a smart pointer on the host, and the view is cleared when the device is freed.

@SeverinDiederichs SeverinDiederichs added the bug Type: Something isn't working label Aug 14, 2026
@SeverinDiederichs

Copy link
Copy Markdown
Collaborator Author

@codex review

@SeverinDiederichs

Copy link
Copy Markdown
Collaborator Author

/run-test

@phsft-bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1d84cde9e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@agheata agheata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The ownership and teardown sequence is coherent: the transport owns the host array, the GPU worker is joined before device cleanup, the constant device pointer is cleared, and the singleton’s non-owning views are reset.

@SeverinDiederichs
SeverinDiederichs merged commit 82c6f66 into apt-sim:master Aug 14, 2026
6 checks passed
@SeverinDiederichs
SeverinDiederichs deleted the fix_volauxdata_memleak branch August 14, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Type: Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants