-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 when running with Jest #1966
Comments
any updates on this issue? |
I noticed it was getting worse in recent versions of Sentry. Still a blocker for us to update, so we're on older version now. |
@xueyongg @kirillgroshkov it has been fixed over 3 months ago in version https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#542
Old heap usage: https://gist.github.com/kamilogorek/c3d8e10287d31c91182dafd42af197f2#file-log_leaking_4-6-6-txt Cheers! |
oh, great fix! But we still see issues with memory in recent versions of Sentry. Issues are probably different, so my old reproduction repo doesn't cover them (or maybe we're doing something more complicated with Sentry that it leaks). When I have time - I'll try to create another repro to highlight new issues. But great work fixing the current issue! |
It'd be greatly appreciated @kirillgroshkov :) |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
We use
@sentry/node
in our unit tests with Jest.We discovered that just importing
@sentry/node
(asconst Sentry = require('@sentry/node')
) leaks memory when running in Jest tests.I've created a minimal repro here to showcase the issue: https://github.com/kirillgroshkov/sentry-jest-leak-repro
Good to note that Jest has memory leak issues with many libraries, not just this one. Some popular libraries, e.g
graceful-fs
were "fixed" to not leak memory with Jest (given that Jest itself is also a "popular library", number 1 in "StateOfJS 2018" to be precise).There's a symmetric issue opened in Jest repo, cause I'm expecting some back-and-forth between this repo and Jest: jestjs/jest#8248
Why this issue is important - it blocks us to run our test suite in our CI environment (CircleCI), which has 4Gb memory constraint. It runs out-of-memory already with ~150 test files that we have in our project. See steps to reproduce further.
Some related issues in Jest:
jestjs/jest#8248
jestjs/jest#6814
jestjs/jest#6738
jestjs/jest#7311
jestjs/jest#6399
The text was updated successfully, but these errors were encountered: