-
-
Notifications
You must be signed in to change notification settings - Fork 675
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
Memory Leak #449
Comments
What memory? Metadata from decorators? The only memory leak that could happen is that you construct the schema multiple times, so e.g. when you use lambda/serverless that shares the same Node.js process but executes modules evaluation and run the schema build on every request. If you want me to tackle this issue, please help and provide more detailed info what does the metadata storage contains, e.g. if the fields that contains all collected metadata like |
@MichalLytek The schema is constructed once at the server start not on every request. You can use this repo to reproduce https://github.com/mahaben/graphql Thanks. |
This repo has very outdated dependencies (
|
Fixed the errors, run the app, call many queries - cannot reproduce, everything looks ok, memory grows to 35MB and then it's garbage collected to 14MB. Please create a full reproduction detailed instruction with repo, node version, steps to record memory, etc. Otherwise will close the issue as invalid. |
Hello, Maybe I was not clear about how to reproduce this bug using the repo. Have you followed these steps? -Start the server in Thanks, |
I've been able to reproduce this leak, but my best guess is that it's the same as nodejs/node#28420. There is no leak on node 10 while there's a massive one on node 12. Unless your library specifically triggers the leak, I'm afraid there's not much you can do. |
Closing as no response from OP, I cannot reproduce and it might be Node.js version related issue 🔒 |
@mahaben |
@MichalLytek Thanks for the |
@mahaben Now we build only explicitly referenced types - you may need to put the interfaces or other types into the |
@MichalLytek Hmm, don't know what i'm doing wrong, here is my code:
|
|
So what should I do to have these resolvers in the schema to avoid this error? Indeed, the resolvers are present in the schema generated in v0.17 and not in v0.18 🤔 |
Put them in the |
😄 this is already the case !! but it doesn't work :( . Didn't change anything between the two versions |
Is it an abstract repository? Maybe it will be faster for you to create a repository with a minimal reproducible code example (not a dump from your project codebase) and create a new issue with that. |
Thanks, I'll create a repo to reproduce. |
@MichalLytek it's okay, solve it 🎉 . Thanks. |
Describe the bug
We are facing a memory leak issue. We have a graphql query that returns 1200 records and called every 10 seconds. Memory keeps increasing over time and never released when the query is stopped.
To Reproduce
-Create a simple entity
-Create a graphql query that returns 1000 records of this entity
-Create a graphql client that calls this query every 10 secs
-Inspect memory
Expected behavior
-Memory should be released
Logs

Environment (please complete the following information):
Thanks.
The text was updated successfully, but these errors were encountered: