We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Do you want to request a feature or report a bug? Bug
What is the current behavior? the heap usage keeps increasing when using mongoose
If the current behavior is a bug, please provide the steps to reproduce.
You can reproduce this bug using this repo https://github.com/graphql-compose/graphql-compose-mongoose from @nodkz
run jest --logHeapUsage
jest --logHeapUsage
heap usage will keep increasing:
You can also run with jest --detectLeaks --detectOpenHandles and check that there are some open handles that keeps Jest from exiting:
jest --detectLeaks --detectOpenHandles
What is the expected behavior? The expect behavior is to clean up the heap usage after each test
Please mention your node.js, mongoose and MongoDB version. mongodb version: 3.x.x and 4.x.x mongoose 5.2.6 node 8.x.x and 10.x.x
related to #2874
more info here jestjs/jest#6787
I've tried to add this to afterEach, afterAll and it did not help
afterEach
afterAll
#2874 (comment)
mongoose.connections.forEach(connection => { const modelNames = Object.keys(connection.models) modelNames.forEach(modelName => { delete connection.models[modelName] }) const collectionNames = Object.keys(connection.collections) collectionNames.forEach(collectionName => { delete connection.collections[collectionName] }) }) const modelSchemaNames = Object.keys(mongoose.modelSchemas) modelSchemaNames.forEach(modelSchemaName => { delete mongoose.modelSchemas[modelSchemaName] })
is there any place where mongoose keep references? that is not garbage collected properly?
The text was updated successfully, but these errors were encountered:
afterAll worked well to reduce memory leak in mongoose
we fixed the rest of leak mocking graphql-redis-subscriptions
graphql-redis-subscriptions
Sorry, something went wrong.
What did you add exactly to the afterAll?
No branches or pull requests
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
the heap usage keeps increasing when using mongoose
If the current behavior is a bug, please provide the steps to reproduce.
You can reproduce this bug using this repo https://github.com/graphql-compose/graphql-compose-mongoose from @nodkz
run
jest --logHeapUsage
heap usage will keep increasing:
You can also run with
jest --detectLeaks --detectOpenHandles
and check that there are some open handles that keeps Jest from exiting:What is the expected behavior?
The expect behavior is to clean up the heap usage after each test
Please mention your node.js, mongoose and MongoDB version.
mongodb version: 3.x.x and 4.x.x
mongoose 5.2.6
node 8.x.x and 10.x.x
related to #2874
more info here jestjs/jest#6787
I've tried to add this to
afterEach
,afterAll
and it did not help#2874 (comment)
is there any place where mongoose keep references? that is not garbage collected properly?
The text was updated successfully, but these errors were encountered: