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

Fix space leak in Shells #381

Merged
merged 1 commit into from
Mar 29, 2020
Merged

Fix space leak in Shells #381

merged 1 commit into from
Mar 29, 2020

Conversation

Gabriella439
Copy link
Owner

Fixes #380

The issue was that all of the Shell utilities were internally using
translate which was inadvertently using a non-strict Maybe
accumulator. Switching to a strict accumulator fixes the problem.

This leak was introduced in version 1.5.0

Fixes #380

The issue was that all of the `Shell` utilities were internally using
`translate` which was inadvertently using a non-strict `Maybe`
accumulator.  Switching to a strict accumulator fixes the problem.

This leak was introduced in version 1.5.0
@Gabriella439
Copy link
Owner Author

I tested this by hand using the following program:

import qualified Control.Foldl as Foldl
import qualified Turtle

main :: IO ()
main = do
    x <- Turtle.fold (Turtle.select [(1::Int)..100000000]) Foldl.sum

    print x

Before this change it leaked, but after this change it runs in constant space:

Screen Shot 2020-03-28 at 4 36 53 PM

@Gabriella439 Gabriella439 merged commit 96b8e9d into master Mar 29, 2020
@Gabriella439 Gabriella439 deleted the gabriel/fix_leak branch March 29, 2020 01:52
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.

Possible memory leak
1 participant