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.timeout() leaks a promise reference after resolution/rejection #371

Closed
henryptung opened this Issue Oct 30, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@henryptung

henryptung commented Oct 30, 2014

Since timeout() uses window.setTimeout() but does not clearTimeout() on resolution/rejection, a handle to the promise (and its resolution data) is leaked in the window for the duration of the timeout, even if the request is rapidly resolved. When the rate of data transfer is very high, this causes the browser to OOM and crash within minutes.

We use promises in the context of requests that have a vastly variable range of latency and transfer speed (between milliseconds and tens of minutes) due to unpredictable network/operational conditions. Promise.timeout() can handle this with a sufficiently large timeout setting, but this causes problems under very low latency conditions.

@nomcopter

This comment has been minimized.

Show comment
Hide comment
@nomcopter

nomcopter Oct 31, 2014

Man that turn around time. Thanks!

nomcopter commented Oct 31, 2014

Man that turn around time. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment