Description
We have been investigating a memory leak in our GraphQL server implementation and believe we have a root cause. We eliminated a lot of the network stack and other external things, and still have a leak.
There is a large retained memory in a Generator
. We believe this is caused by microsoft/TypeScript#36056, which is also referenced in https://stackoverflow.com/questions/58875158/nodejs-memory-growth-memory-leak-in-system. This matches our findings. We do not use any generators in our code, and we compile with babel using latest, which uses async/await
natively.
Looking at the compiled Apollo source, it is littered with __awaiter
.
I am wondering if Apollo can address this by releasing a version that does not use __awaiter
and relies on native async/await?
We do not have many options to address this issue otherwise.
I can add additional information here from the heap dumps if necessary. I believe a test case can be created, unfortunately I do not have one readily available because I have been using our own internal (closed source) Apollo GraphQL server implementation.