You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not perfect but it now settles around 20MB. Some unnecessary values are still there but maybe this will properly get GC'd if needed.
I told them to use requester-fetch instead as it's now supported by recent versions of Node.js. Maybe we could make that the default ? From my own benchmarks it seems better than the Node requester currently but with my proposed fix it would make the Node requester more performant than the fetch one 😅 (with undici)
Client
All
Version
5.15.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Description
We got reports of memory leaks from users of React InstantSearch with Next.js.
It's easy to reproduce, with an
index.mjs
file :Then run
node --inspect index.mjs
, in Chrome openchrome://inspect
and selectindex.mjs
.In the memory tab, the VM instance heap size hovers around 90MB without ever going down.
All responses are retained by the error handler.
I tried patching it by adding
req.removeAllListeners()
as well asresponse.removeAllListeners()
in thisend
handler :algoliasearch-client-javascript/packages/requester-node-http/src/createHttpRequester.ts
Lines 60 to 69 in 36ccbc9
It's not perfect but it now settles around 20MB. Some unnecessary values are still there but maybe this will properly get GC'd if needed.
I told them to use
requester-fetch
instead as it's now supported by recent versions of Node.js. Maybe we could make that the default ? From my own benchmarks it seems better than the Node requester currently but with my proposed fix it would make the Node requester more performant than the fetch one 😅 (with undici)Client
All
Version
5.15.0
Relevant log output
No response
The text was updated successfully, but these errors were encountered: