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

Bug fix for space leak on too frequent calls to performGC #660

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

Conversation

schnecki
Copy link
Contributor

@@ -23,6 +25,15 @@ newtype OptimizerState option = OptimizerState option
grad' :: Loss -> [Parameter] -> Gradients
grad' t p = Gradients (grad t p)

-- | Action that performs garbage collection with a minimum waiting time between calls to `performGC`. This prevents a space leak, that occurs when calling `performGC` too frequently.
performGC' :: IO ()
performGC' = unsafePerformIO $ do
Copy link
Member

Choose a reason for hiding this comment

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

I think unsafePerformIO should not be added.
It may disappear these codes.

@junjihashimoto
Copy link
Member

@schnecki Thank you for your contribution! Do you have any benchmarks?

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.

None yet

2 participants