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

Potential memory leak #85

Closed
phated opened this issue Apr 26, 2016 · 4 comments
Closed

Potential memory leak #85

phated opened this issue Apr 26, 2016 · 4 comments
Assignees
Milestone

Comments

@phated
Copy link
Member

phated commented Apr 26, 2016

In nodejs/readable-stream#202, @mcollina brought up the fact that we might have memory leaks when a Vinyl object with streaming content is cloned. The suggested solution was to delay creation until the streams were needed.

I'm opening this issue so we can discuss further.

@phated
Copy link
Member Author

phated commented Apr 26, 2016

I'm not sure if this is similar in concept, but we are using lazystream when constructing Vinyl objects in vinyl-fs's .src() method (https://github.com/gulpjs/vinyl-fs/blob/master/lib/src/get-contents/stream-file.js#L15-L17)

@mcollina
Copy link
Contributor

Oh, I didn't know lazystream even existed. You want something slightly different, you want a lazystream that can be cloned and passed around. This it's either a PR there or a new module.
I'll see if I can do a prototype of this.

@mcollina
Copy link
Contributor

Here is my take on this issue: https://github.com/mcollina/cloneable-readable.
Please give it a spin, if it helps I need to do one more thing or two regarding error handling.

@phated
Copy link
Member Author

phated commented Apr 27, 2016

@mcollina super cool! I'll give it a try soon.

@phated phated modified the milestone: 2.0 Sep 7, 2016
@phated phated self-assigned this Sep 7, 2016
@phated phated closed this as completed in a6da597 Sep 19, 2016
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