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

Promise内存泄漏 #13

Open
lanjingling0510 opened this issue Apr 10, 2018 · 0 comments
Open

Promise内存泄漏 #13

lanjingling0510 opened this issue Apr 10, 2018 · 0 comments
Assignees

Comments

@lanjingling0510
Copy link

return reader.read().then((result) => {

return this.pump(reader);

嵌套的Prosise形成了一个Promise状态链,外层Promise等待内层Promise调用resolve或者reject,因为V8原生的Promise实现存在缺陷,这样使用之后会积累一大坨Promise,无法被释放,所以就造成了内存泄漏。

1

将两个地方的return去掉

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

3 participants