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

Added missing bang, which seems to resolve the memory leak in #728 #732

Merged
merged 3 commits into from Feb 20, 2019

Conversation

crockeea
Copy link

@crockeea crockeea commented Feb 19, 2019

Fixes #728.

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

@@ -156,7 +156,7 @@ add settings@ReaperSettings{..} stateRef tidRef item =
where
cons NoReaper = let !wl = reaperCons item reaperEmpty
in (Workload wl, spawn settings stateRef tidRef)
cons (Workload wl) = let wl' = reaperCons item wl
cons (Workload wl) = let !wl' = reaperCons item wl
Copy link
Member

Choose a reason for hiding this comment

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

This is a good catch, thanks, and I'm a bit embarrassed for missing it. Question: to hopefully solve this in a more guaranteed way for the future, could you tell me if making the field of the Workload constructor a strict field also solves your problem?

Copy link
Author

Choose a reason for hiding this comment

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

New commit with a strict data constructor instead of the bangs.

@kazu-yamamoto
Copy link
Contributor

This is not directly related to this issue but we should consider to add the following to *.cabal in the future:

  default-extensions:  Strict StrictData

Copy link
Member

@snoyberg snoyberg left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@snoyberg snoyberg merged commit 8f9857b into yesodweb:master Feb 20, 2019
@snoyberg
Copy link
Member

@kazu-yamamoto Funnily enough, I was discussing this bug with @bitemyapp and he also mentioned StrictData.

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

3 participants