-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
-i has memory issue? #5157
Comments
We have the same problem in stylelint/stylelint#3069 Tests finished: Jest 22.0.4:
|
I thought the problem could be because of our code. We run all our tests via custom 'use strict';
global.testRule = () => {
test('test', () => {
expect(true).toBe(true);
});
}; Even with this script All of this is on Node.js 8.9.1 and npm 5.5.1. macOS 10.12.6 on MacBook Pro with 16GB memory. |
Could the contributors / authors help us identify whether this is a bug or not? Thanks. |
Whenever you run with To get more accurate results, you should make sure that the GC is run after each test. Jest already does that, but it needs to be explicitly exposed. You can do that as a fast test by adding |
Hmm, even with the
|
I also tested exposing and forcing Code is in branch |
If the GC is exposed, it will automatically be ran after each test (see here). Running yourself the GC on the The memory growth you see from test to test is due to several reasons:
Hope that solves the mistery! 🙂 |
Gotcha! Thanks. I wondered whether I incorrectly setup the test. I will dig in and see if I can be a contribution :) Thanks for the help / comments. Appreciated! |
@hudochenkov I confirmed that the above PR fixes the leak in stylelint for Jest 22 BeforeAfterThat PR also fixes the |
I think this can be closed:
|
@rickhanlonii thank you for your help! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Reproducing project can be found:
https://github.com/OverseePublic/jest-memory-test
Without the -i
With the -i
Is this a memory bug or expected behavior?
The text was updated successfully, but these errors were encountered: