Skip to content

Implements destructors for chapel-side and python-side rngs - #4898

Merged
ajpotts merged 1 commit into
Bears-R-Us:mainfrom
drculhane:Closes-4869
Sep 15, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:mainfrom
drculhane:Closes-4869

Conversation

@drculhane

Copy link
Copy Markdown
Contributor

Closes #4869

This is an addendum to the global seed generator which implements destructors for the random number generators on both chapel-side and python-side. Prior to this, generators were never destroyed in either place, which resulted in an upward creep of memory usage if the global generator was reseeded thousands of times.

In not-perfectly-accurate tests using htop, I've confirmed that in this version, 100000 reseeds will add 0.01GB to the memory usage, whereas the previous version added 0.3GB to 0.4GB of memory usage.

@drculhane
drculhane marked this pull request as ready for review September 12, 2025 15:36
Comment thread src/RandMsg.chpl Resolved

@ajpotts ajpotts 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.

Looks great! Thanks for figuring this out!

@1RyanK 1RyanK 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.

Looks good!

@jaketrookman jaketrookman 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.

Looks good

@ajpotts
ajpotts added this pull request to the merge queue Sep 15, 2025
Merged via the queue into Bears-R-Us:main with commit b712750 Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add code to delete Generator instances in support of global seeds

4 participants