Skip to content

Conversation

theanarkh
Copy link
Contributor

When using Session, the object outputed by the console API will not be released.

The example is as follows.

const inspector = require('inspector');

class AAA {
    constructor() {
        const len = 10000000;
        this.memory = new Array(len);
        for (let i = 0; i < len; i++) {
            this.memory[i] = i;
        }
    }
};

const session = new inspector.Session();
// comment out this and test again
session.connect();

const heapUsed = process.memoryUsage().heapUsed;
setInterval(() => {
    const obj = new AAA();
    console.log(obj);
    gc();
    console.log(process.memoryUsage().heapUsed - heapUsed);
}, 100);

node --expose-gc test.js

  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. inspector Issues and PRs related to the V8 inspector protocol labels Mar 21, 2023
@theanarkh theanarkh added the review wanted PRs that need reviews. label Mar 29, 2023
@theanarkh theanarkh added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 20, 2023
@nodejs-github-bot nodejs-github-bot merged commit 380996b into nodejs:main Apr 20, 2023
@nodejs-github-bot
Copy link
Collaborator

Landed in 380996b

targos pushed a commit that referenced this pull request May 2, 2023
@targos targos mentioned this pull request May 2, 2023
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. inspector Issues and PRs related to the V8 inspector protocol review wanted PRs that need reviews.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants