feat: add maxMemoryLimitBeforeRecycle options#58
Conversation
|
@sheremet-va any thoughts? Maybe you could test this against vitest-dev/vitest#3203 before we merge and release this? |
|
@AriPerkkio Any updates on this PR? |
|
No updates from my side. I think this should work as is but maybe let's first test this with Vitest's work-in-progress |
I did not check it yet, VM support is not on my list yet, but will be in a few weeks. I was planning to release a sort of "road map" where everyone can see open PRs and help. Feel free to test this with an open VM PR yourself and make changes if you need to. |
7ba4ec7 to
8e39223
Compare
|
Looks like we can merge this and release a new version. |
|
Testing this with Vitest and seeing crashes when final round of tests are run and workers are recycled. I think this condition needs some changes: Line 708 in 28ba15f Looking into this. |
The implementation is highly inspired by
jest-worker'sidleMemoryLimitoption.Each worker reports their
process.memoryUsage().heapUsedto main thread when they have finished the current task. Main thread compares this limit to pool's new memory limit option and decides whether worker should be terminated and replaced with new one.