-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Search] Memory leaks caused by AbortController #65051
Comments
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Please note: |
While I was looking into #79498 I noticed that this memory leak issue is more significant than it could have seemed. (this issue is not related to #79498) Every single search slowly leaks memory because of AbortController usage. Most of leaks are a closure leak from abort utils This is what I saw for a dashboard with a bunch of panels with a frequent refresh interval open for couple minutes:
In general they retained 43mb in memory @lizozom @lukasolson, I think makes sense to prioritise this and tackle in this cycle. |
While digging into search code noticed potential improvements around requests cancelation:
But it could happen that client already asked to abort request and it seems to handle that case we have to handle it separately:
e.g.:
Such scenario happened to me in dashboard.
abortSignal.addEventListener('abort', abort);
. note: RxJS fromEvent handle unsubscribe when we unsubscribe from observable.To confirm this is needed, for example, fetch polyfill does this: https://github.com/github/fetch/blob/master/fetch.js#L534
The text was updated successfully, but these errors were encountered: