-
Notifications
You must be signed in to change notification settings - Fork 605
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
Memory leak in Signal#discrete
#799
Comments
https://github.com/functional-streams-for-scala/fs2/blob/series/1.0/core/shared/src/main/scala/fs2/async/mutable/Signal.scala#L106 is definitelly recursing the bracket pilling up cleanups |
I think we will need to create proper Tag for the discrete subscriber and cleanup registration from the outer scope of go. |
@pchlupacek yup we just spotted the same thing... figuring out fix |
@pchiusano @mpilquist just for curiosity any progress on that? Eventually, I can tackle this, as we are about to move part of our production to fs2, with heavy signal usage. lmk pls. I would like also make 9.3 with this patch, or if there is something else worth of backporting from 1.0 lmk |
I haven't made any progress (was busy with work stuff yesterday). I definitely agree we need a 0.9.3 with this fix. I'll look through the 1.0 commits and see what can be backported. |
lmk if you want to fix that or I shall do it. My approach will be to introduce Id/Tag of discrete subscriber and clean it on bracket finalisation, instead on every step. Any thoughts? |
Sure, have at it. |
Yeah, go for it... sorry I also didn't get to this yesterday.
…On Thu, Feb 9, 2017 at 9:17 AM, Michael Pilquist ***@***.***> wrote:
Sure, have at it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#799 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAArQnRFfuH-dA0W2bWJo808WXwuuK6gks5rayAVgaJpZM4L67XU>
.
|
@mpilquist, @pchiusano see #802 with backport in #803 |
also threw in Traverse improvements, hope you won't mind |
Fixed in 0.9.3 and 1.0.0. |
This program should run in constant memory but it doesn't:
Based on some quick heap analysis, it looks like we are leaking resource cleanup -- e.g., a huge
LongMap
, a ton ofToken
s, etc.Each element through
discrete
results in a newStream.bracket
. I suspect the finalizers are getting promoted to higher scope due to the async effect ofsignal.set
.Note: same test using
continuous
runs in constant memory:The text was updated successfully, but these errors were encountered: