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

Add CLI option for specifying heapsnapshot prefix filename #40363

Closed
paulrutter opened this issue Oct 7, 2021 · 3 comments
Closed

Add CLI option for specifying heapsnapshot prefix filename #40363

paulrutter opened this issue Oct 7, 2021 · 3 comments
Labels
cli Issues and PRs related to the Node.js command line interface. feature request Issues that request new features to be added to Node.js. stale

Comments

@paulrutter
Copy link

paulrutter commented Oct 7, 2021

The CLI option --heapsnapshot-near-heap-limit was introduced to Node.js 14.18.0 in #33010. Although this works as expected, i have a usecase where i would like to predefine how the heapsnapshot file will be named (when it goes out of memory).
The usecase is about a main node process forking several child processes. When one of those goes out of memory, i would like to know which one it is (based on the given prefix filename).

See #33010 (comment).

Desired behavior
Have a new CLI option called --heapsnapshot-filename-prefix which is used to prepend the default filename (Heap.YYYYMMDD.HHmmSS.${pid}.${threadid}.${count}.heapsnapshot).

For example:
node --heapsnapshot-filename-prefix=FooHeapsnapshot --heapsnapshot-near-heap-limit=1 would lead to FooHeapsnapshot.YYYYMMDD.HHmmSS.${pid}.${threadid}.${count}.heapsnapshot when an out of memory occurs.

Current alternative
Current workaround would be to keep track of a forked process process id, and use that to rename a possible heapsnapshot when the process has exited.

@VoltrexKeyva VoltrexKeyva added cli Issues and PRs related to the Node.js command line interface. feature request Issues that request new features to be added to Node.js. labels Oct 7, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2022

There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Apr 6, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2022

There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.

For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot closed this as completed May 7, 2022
@imcotton
Copy link
Contributor

imcotton commented May 7, 2022

This could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. feature request Issues that request new features to be added to Node.js. stale
Projects
Development

No branches or pull requests

3 participants