You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From snapshotting the heap and reading the logs, it looks like initializeLanguageServiceInstance (see language-service.ts) gets called for each jest project, which keeps a cache of transpiled and instrumented code in memory (memoryCache) which never gets cleared
Workaround
If you encounter this issue, using ts-jest's isolatedModules might help.
In the example repo, run yarn test:isolated-modules as an example
The text was updated successfully, but these errors were encountered:
🐛 Bug Report
Memory usage is high when running ts-jest with jest projects.
To Reproduce
Steps to reproduce the behavior:
You will see tests running with a high heap size.
Expected behavior
Much lower memory usage.
Link to repo (highly encouraged)
https://github.com/richardcornelissen/ts-jest-projects-oom
Debug log:
Too large to inline, available at https://raw.githubusercontent.com/richardcornelissen/ts-jest-projects-oom/main/ts-jest.log
envinfo
Potential cause
From snapshotting the heap and reading the logs, it looks like
initializeLanguageServiceInstance
(see language-service.ts) gets called for each jest project, which keeps a cache of transpiled and instrumented code in memory (memoryCache
) which never gets clearedWorkaround
If you encounter this issue, using
ts-jest
'sisolatedModules
might help.In the example repo, run
yarn test:isolated-modules
as an exampleThe text was updated successfully, but these errors were encountered: