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

NX task runner huge memory leak dangling processes #30266

Open
1 of 4 tasks
nhhockeyplayer opened this issue Mar 5, 2025 · 2 comments
Open
1 of 4 tasks

NX task runner huge memory leak dangling processes #30266

nhhockeyplayer opened this issue Mar 5, 2025 · 2 comments

Comments

@nhhockeyplayer
Copy link

nhhockeyplayer commented Mar 5, 2025

Current Behavior

SUBJECT: NX task runner huge memory leak dangling processes

Under normal iterative development conditions BUT debug (particularly debug)
Launching NX admin-api nestjs app as follows
nx run admin-api:serve:development

Developer then uses any IDE (vscode or JetBRAINS WebStorm) to launch a debug session
IDE terminates sessions fine
Whats left behind are Nx task processes
they pile up
the machine is eventually floored, cannot even render a web page
takes 30secs to even do a copy/paste operation

This is catastrophic to my current development momentum

Nx is leaving behind it a plethora of NX processes

The development machine MacBook is floored, CPU hijacked and Memory consumed

developer is left with manually (via terminal) terminating and killing each individual task left hanging running in the background

nx reset is not a solution because during intensive debugging and iteration start/stop/reload processes pile up
and we cannot see whats piling up
until the machine is unusable
then manual intervention is needed

thank you for an elite awesome product (just need finishing touches)

Expected Behavior

No processes should be left dangling consuming CPU/Memory
before after or in between

GitHub Repo

use any medium sized scaffold that develops a nestjs backend app

Steps to Reproduce

nx run admin-api:serve:development

launch IDE and begin to debug

try and set breakpoints

Nx Report

nx report
Unable to find local plugin [] Map(0) {}
Unable to find local plugin [] Map(0) {}

 NX   Report complete - copy this into the issue template

Node           : 22.0.0
OS             : darwin-x64
Native Target  : x86_64-macos
yarn           : 1.22.22

nx (global)            : 20.4.6
nx                     : 20.4.6
@nx/js                 : 20.4.6
@nx/jest               : 20.4.6
@nx/eslint             : 20.4.6
@nx/workspace          : 20.4.6
@nx/angular            : 20.4.6
@nx/cypress            : 20.4.6
@nx/devkit             : 20.4.6
@nx/esbuild            : 20.4.6
@nx/eslint-plugin      : 20.4.6
@nx/express            : 20.4.6
@nx/module-federation  : 20.4.6
@nx/nest               : 20.4.6
@nx/node               : 20.4.6
@nx/playwright         : 20.4.6
@nx/web                : 20.4.6
@nx/webpack            : 20.4.6
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/webpack/plugin
@nx/cypress/plugin
@nx/eslint/plugin
@nx/webpack/plugin
@nxext/capacitor/plugin
---------------------------------------
Community plugins:
@compodoc/compodoc               : 1.1.26
@fortawesome/angular-fontawesome : 1.0.0
@ionic/angular                   : 8.4.3
@jsverse/transloco               : 7.5.1
@ngrx/component                  : 19.0.1
@ngrx/component-store            : 19.0.1
@ngrx/effects                    : 19.0.1
@ngrx/entity                     : 19.0.1
@ngrx/operators                  : 19.0.1
@ngrx/router-store               : 19.0.1
@ngrx/schematics                 : 19.0.1
@ngrx/store                      : 19.0.1
@ngrx/store-devtools             : 19.0.1
@nxext/capacitor                 : 20.1.0
@nxext/ionic-angular             : 20.0.5
angular-eslint                   : 19.1.0
apollo-angular                   : 8.0.2

Failure Logs

meanstack02@admin meanstack % ps -ef | grep nx
  501  2656     1   0  7:19PM ??         0:40.56 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Users/meanstack02/.vscode/extensions/nrwl.angular-console-18.41.1/nxls/main.js --node-ipc --clientProcessId=2617
  501  5774     1   0  9:42PM ??         0:03.16 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/daemon/server/start.js
  501  5778  5774   0  9:43PM ??         0:05.44 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-0.sock
  501  5779  5774   0  9:43PM ??         0:03.38 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-1.sock
  501  5780  5774   0  9:43PM ??         0:00.53 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-2.sock
  501  5781  5774   0  9:43PM ??         0:05.47 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-3.sock
  501  5782  5774   0  9:43PM ??         0:03.39 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-4.sock
  501  5783  5774   0  9:43PM ??         0:00.19 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-5.sock
  501  5784  5774   0  9:43PM ??         0:03.58 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-6.sock
  501  5785  5774   0  9:43PM ??         0:00.39 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-7.sock
  501  5786  5774   0  9:43PM ??         0:00.36 /usr/local/bin/node/bin/node /Users/meanstack02/meanstack/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker /var/folders/73/pgw9tfdj5fz826zd6cc4p0vr0000gn/T/plugin5774-8.sock
  501  5800  5193   0  9:43PM ttys002    0:00.00 grep nx
meanstack02@admin meanstack %

Package Manager Version

npm --version 10.5.1yarn --version 1.22.22

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

developer remains unimpressed with the quality of both vscode and webstorm ad neither interfaces permit turn-key debugging and setting breakpoints for backend nestjs server apps
those features are left half implemented and for the developer to hack their way thru with the variety of launch interfaces (attach/launch) much of which cannot articulate tsconfig-paths for typescript sources and sourcemaps

@nhhockeyplayer
Copy link
Author

nx reset cleans it up
but that cannot become one of my regular every 10 commands effort that would be wrong to impose

@nhhockeyplayer
Copy link
Author

nhhockeyplayer commented Mar 6, 2025

if I launch a backend server
and it reloads with new changes to relaunch
processes start piling up in the background
it eventually gets confused after overwhelmed, starts klacking and eventually hangs
machine brought to literal halt
solution... kill terminal and cleanup anything left dangling hung

now this could be debug sessions created by webstorm since its debugger is not what it use to be
and in order to debug one has to deviate they de-coupled the entire model now

if Nx chooses to investigate this its encouraged to try and use webstorm
and debug a nestjs server app
and do the live reload over and over
and you will see the pile up of processes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant