Skip to content

Reproduction for jest memory leak (>=25.1.0) when using --runInBand option

Notifications You must be signed in to change notification settings

bcluyse/jest-runinband-memory-leak-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest memory leak reproduction

When running jest >= 25 - 27.4.4 with the --runInBand option, it seems to leak memory when importing modules even when the tested files are trivial.

How to run

Install all dependencies by running

npm run build

Run the test set in tests/ with version 24.9.0

npm run test24

Run the test set in tests/ with version 25.1.0

npm run test25

Results

When attaching a debugger, after the test run and garbage collection, the memory in use by v24 is considerably lower than the memory in use by 25. Memory snapshots can be found in /results, as you can see below, there are multiple strings in memory which seem to be the lodash module.

Memory-snapshot-25

About

Reproduction for jest memory leak (>=25.1.0) when using --runInBand option

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published