Skip to content

Start node in inspect mode will cause CPU consumption 100% #25077

New issue

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

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

Already on GitHub? # to your account

Closed
wu-jingtao opened this issue Dec 16, 2018 · 3 comments
Closed

Start node in inspect mode will cause CPU consumption 100% #25077

wu-jingtao opened this issue Dec 16, 2018 · 3 comments

Comments

@wu-jingtao
Copy link

  • docker:10-stretch
  • Host computer:Linux test 4.4.0-137-generic io.js TC Meeting 2014-12-17 #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I find when using child_process.fork to spawn the third layer child process with the debugger mode will cause CPU consumption to 100%,this problem will keep until you use a debugger tool ( like chrome debugger tool ) to connect it. after connected, the CPU consumption will soon drow back to normal status.

I`m sure this is not my code`s problem, and I`ve tried in my notebook and cloud server, this problem will always occur.

Process tree:

node .
    └  /usr/local/bin/node /app/subprocess.js
         └  /usr/local/bin/node --inspect-brk=127.0.0.1:6060 /app/third.js

Main process code:

child_process.fork(path.resolve(__dirname, './subprocess.js'))

Subprocess code:

 const child = child_process.fork(taskFilePath, [], {
     cwd: FilePath._programDataDir,
     execArgv: debug ? [`--inspect-brk=127.0.0.1:${debugPort}`] : [],
     stdio: ['pipe', 'pipe', 'pipe', 'ipc']
});
@joshuakb2
Copy link

I also experience this problem pretty much every day. My laptop fan gets really loud so it's impossible to miss. Every time I start a process with --inspect-brk, CPU usage goes to 100%, regardless of whether or not I am launching a subprocess.

I'm using Node version 12.2.0.

@alexkozy
Copy link
Member

cc @eugeneo

@targos
Copy link
Member

targos commented Jul 21, 2019

Should have been fixed by #28756

@targos targos closed this as completed Jul 21, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants