Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak - npm subprocesses #213115

Closed
stacy-rendall opened this issue May 21, 2024 · 10 comments
Closed

Memory leak - npm subprocesses #213115

stacy-rendall opened this issue May 21, 2024 · 10 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@stacy-rendall
Copy link

stacy-rendall commented May 21, 2024

Does this issue occur when all extensions are disabled?: TBC

  • VS Code Version: 1.89.1 and 1.89.0
  • OS Version: Windows 10, Windows 11

Steps to Reproduce:

  1. Open an Node.js project in VS Code/VS Codium
  2. ...can't tell what initiates it, sometimes happens after a few minutes, sometimes never happens...
  3. VS Code starts spawning thousands of subprocesses until the computer runs out of memory
  4. the subprocesses that continually appear under VS Code in Task Manager are npm view --json -- <something> dist-tags.latest homepage version time, until Task Manager becomes unresponsive
  5. rolling back to 1.88.x seems to fix the issue

Currently testing with extensions disabled, will update here if it happens again with extensions disabled.

@vscodenpa
Copy link

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.89.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@meganrogge meganrogge assigned deepak1556 and unassigned meganrogge May 21, 2024
@meganrogge meganrogge added the info-needed Issue requires more information from poster label May 21, 2024
@meganrogge
Copy link
Contributor

pls let us know what happened with extensions disabled

@stacy-rendall
Copy link
Author

stacy-rendall commented May 22, 2024

Still haven't been able to reliably reproduce the error - it did happen once while I had only ESLint extension enabled, and I ran npm i or npm update in the folder, but I haven't been able to force it to happen again - typically I am working across multiple VS Code windows in different repositories, so it may be a multiple step repro

@deepak1556 deepak1556 assigned chrmarti and unassigned deepak1556 May 22, 2024
@deepak1556
Copy link
Collaborator

The command in question comes from the builtin npm extension

const args = ['view', '--json', '--', pack, 'description', 'dist-tags.latest', 'homepage', 'version', 'time'];
It would be good to have a reliable repro to help us debug this issue further. Thanks!

@chrmarti
Copy link
Collaborator

@meganrogge #210601 was added between the two versions.

@chrmarti chrmarti assigned meganrogge and unassigned chrmarti May 22, 2024
@stacy-rendall
Copy link
Author

stacy-rendall commented May 22, 2024

Thanks @chrmarti - that's the missing link, I can reliably reproduce the issue now, simply by hovering over a package version in package.json (all extensions disabled)

Node version 20.13.1
NPM 10.8.0

On one of my PCs exhibiting the issue Node was installed via Volta 1.1.1 (so not corepack enabled), can't check the other install right now but I think it was installed via NVS or similar...

@frankli0324
Copy link
Contributor

@stacy-rendall I think the command is missing some of the environment variables I forgot to inherit from the main process and should be fixed by #212856

@frankli0324
Copy link
Contributor

should be already fixed by #213306

@stacy-rendall
Copy link
Author

I can confirm that the issue is no longer occurring in Version: 1.90.0-insider

@meganrogge
Copy link
Contributor

closing given it doesn't reproduce in insider's

@microsoft microsoft locked and limited conversation to collaborators Jul 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

6 participants