Skip to content

Memory leak with debugger running. #28787

@laino

Description

@laino
  • Version: v11.15.0
  • Platform: Linux

Edit: Removed information about #28786 making this hard to debug, as it has been fixed in v12.7.0.

This bug might also be the same as, or related to, this bug, but because I'm unsure whether it's the same and because this one contains a minimal example, I've filed a separate issue.

Run this with node --inspect script.js and attach chrome:

// edit: simplified example

async function noop() {}

async function run() {
    while (true) {
        await noop();
    }
}

run();

You can see memory usage getting out of hand as soon as you attach google chrome:

5454
Before connecting with Chrome's debugger.

5455
A few seconds after connecting with Chrome's debugger.

This is what you see if you manage to grab a heapdump before it crashes:
5468

The eventual crash when it runs out of memory is in a comment below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocolmemoryIssues and PRs related to the memory management or memory footprint.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions