Skip to content

improve memory usage for hostTrackData #431

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SeverinDiederichs
Copy link
Collaborator

@SeverinDiederichs SeverinDiederichs commented Aug 21, 2025

This PR improves the data usage of the HostTrackData.

Before, when tracks were deleted, the g4idToGPUid map could not be cleaned as it is still needed if a track goes from GPU to CPU to GPU. In that case, we have to ensure that the second time the track goes to the GPU it has the same track ID as the first time, as the track ID is used to seed the RNG. However, when the track is killed, we can safely delete all of it. Now, we have two functions, one to fully remove a track from the hostTrackData when the track is killed and one to "retire" it to the CPU so that we keep the g4idToGPUid in case the CPU decides to put the track back on the GPU. This is only needed in case the of a out-of-gpu-region leak.

Also, a destructor is added to clean all data, as before the data was only cleaned upon a new event, leading to a memory leak

@SeverinDiederichs SeverinDiederichs added the cleaning improves code clarity, readability or other label Aug 21, 2025
@phsft-bot
Copy link

Can one of the admins verify this patch?

@SeverinDiederichs SeverinDiederichs added the enhancement Type: New feature or request label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleaning improves code clarity, readability or other enhancement Type: New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants