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

async seems to keep port writers alive #20

Open
doudou opened this issue Sep 3, 2014 · 2 comments
Open

async seems to keep port writers alive #20

doudou opened this issue Sep 3, 2014 · 2 comments

Comments

@doudou
Copy link
Member

doudou commented Sep 3, 2014

The non-block version of InputPort#writer calls #proxy_event on the port object, thus adding a reference from the port to the writer object. This avoids garbage collection of the writer, and thus creates a memory leak.

I guess that the same issue exists for the readers.

My gut feeling is that it could be fixed by making sure that #proxy_event uses WeakRef to reference the proxied objects.

doudou referenced this issue in planthaber/rock-webapp-old Sep 3, 2014
@D-Alex
Copy link
Member

D-Alex commented Sep 5, 2014

The reference is used to propagate errors from the reader/writer to the port. I guess we could change the code to do the propagation from the reader/writer side

@doudou
Copy link
Member Author

doudou commented Sep 6, 2014

The issue is that I've seen this pattern quite a few times, that's why I was wondering about moving to a WeakRef implementation instead (it makes sure we don't get the problem ...). But it is also more changes, and only the reader/writer stuff is problematic from a ressource point of view (they maintain a connection to the port).

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

No branches or pull requests

2 participants