Skip to content

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

Description

@wu-jingtao
  • 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']
});

Activity

  1. joshuakb2 commented on Jun 18, 2019

    @joshuakb2

    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.

  2. alexkozy commented on Jun 20, 2019

    @alexkozy
    Member
  3. targos commented on Jul 21, 2019

    @targos
    Member

    Should have been fixed by #28756

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions