Skip to content

Memory leak with debugger running. #28787

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.

Activity

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

    inspectorIssues and PRs related to the V8 inspector protocol.memoryIssues and PRs related to Node.js memory management or memory footprint.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions