-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak around
global.process
Summary: This memory leak was discovered in #584 and has always been present in jest. It likely affects the runtime performance of jest on low-memory machines *a lot* and we don't notice it much on devservers. I will tag and release 0.7.0 with this fix (because 0.7.0 also removes a bunch of APIs, see the changelog, it cannot be a patch release). Two samples from before and after: * P20276376 (150 mb vs 47 mb on 34 Relay tests) * P20276601 (54 mb vs 38 mb flat on the functional tests) I also added a way to pretty print the output (see the second paste). By adding `--logHeapUsage` to jest it adds these statistics after every test run. When node's global `gc` function is exposed, it calls it beforehand to make sure we are logging accurate data. I am going to think about whether it makes sense to expose this more easily (adding `--runInBand` etc. is slightly confusing) if I am confident it isn't bad for performance. On automated test runs you might want to log this and be able to log the final memory usage to whatever logging system you use to be able to track memory usage of test runs (and applications) over time. Note: It is time we rewrite jest's configs *completely*. I have plans for this and it is a discussion for a separate diff. For now I have to copy-pasta some code to make everything work in the internal and external runners and tack on the argv data to the config objects. public Reviewed By: DmitrySoshnikov Differential Revision: D2608363 fb-gh-sync-id: ab3bda143c22ef06e2e1b32a4c92d8ad0a2151cb
- Loading branch information
Showing
7 changed files
with
65 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters