vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Memory Leak with threads enabled

Open JonasKruckenberg opened this issue 3 years ago • 2 comments

Describe the bug

When setting threads: true (the default) a full rebuild (as happens when you press ctrl+s in the config file) leaks memory. The amount of memory is proportional to the amount of test files/source files present.

Reproduction

Here is a minimal reproduction that uses a very large snapshot to inflate memory usage.

  1. Run vitest and make sure to have threads enabled
  2. Navigate to the vite.config.ts file and press ctrl+s many times
  3. See the memory usage of the node process increase

System Info

System:
    OS: macOS 12.4
    CPU: (8) arm64 Apple M1
    Memory: 1023.63 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/Library/Caches/fnm_multishells/73424_1648464793541/bin/node
    Yarn: 3.0.1 - ~/.yarn/bin/yarn
    npm: 8.5.0 - ~/Library/Caches/fnm_multishells/73424_1648464793541/bin/npm
  npmPackages:
    vite: ^2.8.6 => 2.8.6 
    vitest: ^0.6.0 => 0.6.0

Used Package Manager

yarn

Validations

JonasKruckenberg avatar Apr 10 '22 18:04 JonasKruckenberg

I experience the exact same issue.

vrslev avatar May 19 '22 09:05 vrslev

any updates regarding this issue?

HashemKhalifa avatar Mar 26 '23 23:03 HashemKhalifa