-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Specification
During #534 we discovered some potential memory leaks. The Ci job for the tests/client domain was running out of memory and core dumping. There seems to be a problem here.
Running the client domain tests with npm run test -- --runInBand --logHeapUsage tests/client shows a steady increase of heap usage between tests totalling 1.2GB of heap used by the end.
A stopgap measure has been taken by running jest with the node option --expose-cg allowing jest to trigger garbage collection between tests. 52 test files have been combined into 7 files, one for each domain. This is enough to solve the problem for now.
Given that reducing the number of files significantly reduced the memory usage, this suggests that the main memory leak is related to the global scope and imports in some fashion.
Further work needs to be done to discover these leaks and resolve them.
Additional context
- Related CLI migration #534
- Related commit 18b0d59
Tasks
- Investigate the source of the leaks.
- Do A|B testing per domain to determine where the majority of the memory is being used