Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

inspector: add tips for Session #47195

Merged
merged 1 commit into from
Apr 20, 2023

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
6 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 380996b

targos pushed a commit that referenced this pull request May 2, 2023
PR-URL: #47195
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
@targos targos mentioned this pull request May 2, 2023
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
PR-URL: #47195
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
PR-URL: nodejs#47195
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
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.

None yet

3 participants