GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — util: integrate node-heapdump into core by jasnell · Pull Request #26501 · nodejs/node

Conversation

@jasnell

@jasnell jasnell commented Mar 7, 2019

Copy link
Copy Markdown
Member

Adds v8.heapdump.getHeapdump() and v8.heapdump.triggerHeapdump(filename) methods with impl adapted from the node-heapdump module.

Not included is the SIGUSR2 signal, which can be handled by userland.

/cc nodejs/diagnostics#279
@nodejs/diagnostics

Also see: #26498

Checklist
  • 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss, amitbeck, and yanzexuan1 reacted with thumbs up emoji ronkorving, bricss, mmarchini, jmorrell, amitbeck, and paulrutter reacted with hooray emoji bricss, jmorrell, and amitbeck reacted with eyes emoji
All reactions
  • 👍 3 reactions
  • 🎉 6 reactions
  • 👀 3 reactions
@nodejs-github-bot

nodejs-github-bot commented Mar 7, 2019

Copy link
Copy Markdown
Collaborator

@jasnell build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/2806/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. tools Issues and PRs related to the tools directory. labels Mar 7, 2019
richardlau
richardlau approved these changes Mar 7, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau reviewed Mar 8, 2019
View reviewed changes
Comment thread tools/license-builder.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

ronkorving
ronkorving reviewed Mar 8, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

ronkorving
ronkorving reviewed Mar 8, 2019
View reviewed changes
Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis approved these changes Mar 8, 2019
View reviewed changes
Comment thread tools/license-builder.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina requested changes Mar 8, 2019
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

v8.heapdump.getHeapdump() data format is missing in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Mar 8, 2019

Copy link
Copy Markdown
Member Author

Based on some conversations around this, I'm considering just removing the getHeapdump() option and just keeping the write-to-disk option only.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung reviewed Mar 8, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig cjihrig mentioned this pull request Mar 8, 2019
report: rename triggerReport() to writeReport() #26527
Merged
4 tasks done
@jasnell
jasnell force-pushed the heapdump branch from 0890c08 to af77a99 Compare March 9, 2019 11:10
@jasnell

jasnell commented Mar 9, 2019

Copy link
Copy Markdown
Member Author

Updated the PR to:

  1. Remove the getHeapdump() function
  2. Added a note indicating that the heapdump file format is V8 specific and intended to be loaded in tools like Chrome DevTools
  3. Added a note about heapdumps being isolate/thread specific along with an example of taking heapdumps of the main thread and worker threads.
  4. Since there is only the one method, changed from v8.heapdump.triggerHeapdump() to just v8.triggerHeapdump()

@bnoordhuis and @richardlau ... may I ask you both to reaffirm your sign-off with the updates.

@mcollina ... may I ask you to review the doc updates to see if they address your concerns.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax
addaleax approved these changes Mar 9, 2019
View reviewed changes
Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tools/license-builder.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Mar 9, 2019
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell

jasnell commented Mar 9, 2019 via email

Copy link
Copy Markdown
Member Author
Ah! Nice.
…
On Sat, Mar 9, 2019, 13:44 Colin Ihrig ***@***.***> wrote: ***@***.**** commented on this pull request. ------------------------------ In doc/api/v8.md <#26501 (comment)>: > @@ -135,6 +135,31 @@ to get swapped out by the operating system. } ``` +## v8.heapdump.getHeapdump() +<!-- YAML +added: REPLACEME +--> + +* Returns: {Object} + +Returns an object containing a snapshot of the current V8 heap. + +## v8.heapdump.triggerHeapdump([filename]) @jasnell <https://github.com/jasnell> see #26527 <#26527> — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#26501 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAa2eatm0uknLHz91dYPrHfztyTSgNR5ks5vU7qjgaJpZM4bkOxw> .
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung reviewed Mar 9, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt vsemozhetbyt added v8 engine Issues and PRs related to the V8 dependency. semver-minor PRs that contain new features and should be released in the next minor version. labels Mar 9, 2019
vsemozhetbyt
vsemozhetbyt reviewed Mar 9, 2019
View reviewed changes

@vsemozhetbyt vsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some doc nits.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt vsemozhetbyt added the memory Issues and PRs related to Node.js memory management or memory footprint. label Mar 9, 2019
@jasnell
jasnell force-pushed the heapdump branch from 6fe05dd to f7bb696 Compare March 10, 2019 03:06
@jasnell

jasnell commented Mar 10, 2019

Copy link
Copy Markdown
Member Author

@joyeecheung ... PTAL, I added a getHeapdump() variant that returns a stream.Readable

paulrutter reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vsemozhetbyt
vsemozhetbyt reviewed Mar 10, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

addaleax
addaleax reviewed Mar 10, 2019
View reviewed changes
Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau reviewed Mar 10, 2019
View reviewed changes
Comment thread doc/api/v8.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell force-pushed the heapdump branch from f7bb696 to 73ac155 Compare March 11, 2019 00:22
@jasnell

jasnell commented Mar 11, 2019

Copy link
Copy Markdown
Member Author

@vsemozhetbyt @addaleax @richardlau ... PTAL

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell

jasnell commented Mar 11, 2019

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/21414/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
jasnell force-pushed the heapdump branch from b4c7696 to 8124e76 Compare March 12, 2019 22:38
@jasnell

jasnell commented Mar 12, 2019

Copy link
Copy Markdown
Member Author

CI is good

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung reviewed Mar 13, 2019
View reviewed changes
Comment thread lib/v8.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/heap_utils.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jasnell
[Squash] moar nits
4d5292d
@jasnell

jasnell commented Mar 13, 2019

Copy link
Copy Markdown
Member Author

Ok @joyeecheung ... hopefully that'll be the last few nits fixed. This should be ready to go.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Mar 13, 2019

Copy link
Copy Markdown
Member

CI: https://ci.nodejs.org/job/node-test-pull-request/21502/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

joyeecheung
joyeecheung approved these changes Mar 13, 2019
View reviewed changes

@joyeecheung joyeecheung left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for following up with the reviews!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jasnell

jasnell commented Mar 13, 2019

Copy link
Copy Markdown
Member Author

Resume for flaky failure:https://ci.nodejs.org/job/node-test-pull-request/21505/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell added a commit that referenced this pull request Mar 13, 2019
@jasnell
v8: integrate node-heapdump into core
5f38797
Adds `v8.writeHeapSnapshot(filename)` with impl adapted
from the `node-heapdump` module.

Also, adds a v8.getHeapSnapshot() alternative that returns
a Readable Stream

PR-URL: #26501
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
@jasnell

jasnell commented Mar 13, 2019

Copy link
Copy Markdown
Member Author

Landed in 5f38797 ... thanks all

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasnell jasnell closed this Mar 13, 2019
@richardlau richardlau mentioned this pull request Mar 13, 2019
test: whitelist the expected modules in test-bootstrap-modules.js #26531
Merged
3 tasks done
@richardlau richardlau mentioned this pull request Mar 15, 2019
lib: lazy load v8 in error-serdes #26689
Closed
2 tasks done
richardlau added a commit to richardlau/node-1 that referenced this pull request Mar 15, 2019
@richardlau
lib: lazy load v8 in error-serdes
5f19b8f
Lazy loading `v8` in `lib/internal/error-serdes.js` reduces the number
of loaded modules by the bootstrap code for Worker threads by seven.

Refs: nodejs#26501 (comment)
pull Bot pushed a commit to SimenB/node that referenced this pull request Mar 19, 2019
@richardlau @danbev
lib: lazy load v8 in error-serdes
927f29d
Lazy loading `v8` in `lib/internal/error-serdes.js` reduces the number
of loaded modules by the bootstrap code for Worker threads by seven.

PR-URL: nodejs#26689
Refs: nodejs#26501 (comment)
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
targos pushed a commit to targos/node that referenced this pull request Mar 27, 2019
@jasnell @targos
v8: integrate node-heapdump into core
9092e12
Adds `v8.writeHeapSnapshot(filename)` with impl adapted
from the `node-heapdump` module.

Also, adds a v8.getHeapSnapshot() alternative that returns
a Readable Stream

PR-URL: nodejs#26501
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
targos pushed a commit that referenced this pull request Mar 27, 2019
@richardlau @targos
lib: lazy load v8 in error-serdes
cc4a25a
Lazy loading `v8` in `lib/internal/error-serdes.js` reduces the number
of loaded modules by the bootstrap code for Worker threads by seven.

PR-URL: #26689
Refs: #26501 (comment)
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
targos added a commit that referenced this pull request Mar 27, 2019
@targos
2019-03-28, Version 11.13.0 (Current)
04903d8
Notable changes:

* events:
  * Added a `once` function to use `EventEmitter` with promises
    (#26078).
* tty:
  * Added a `hasColors` method to `WriteStream`
    (#26247).
  * Added NO_COLOR and FORCE_COLOR support
    (#26485).
* v8:
  * Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
    in the format used by tools such as Chrome DevTools
    (#26501).
* meta:
  * Gireesh Punathil is now a member of the Technical Steering Committee
    (#26657).
  * Added ZYSzys to collaborators (#26730).

PR-URL: #26949
@targos targos mentioned this pull request Mar 27, 2019
v11.13.0 release proposal #26949
Merged
targos added a commit that referenced this pull request Mar 28, 2019
@targos
2019-03-28, Version 11.13.0 (Current)
29867f3
Notable changes:

* crypto
  * Allow deriving public from private keys (Tobias Nießen)
    [#26278](#26278).
* events
  * Added a `once` function to use `EventEmitter` with promises
    (Matteo Collina) [#26078](#26078).
* tty
  * Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
    [#26247](#26247).
  * Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
    [#26485](#26485).
* v8
  * Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
    in the format used by tools such as Chrome DevTools (James M Snell)
    [#26501](#26501).
* worker
  * Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
    different vm.Contexts, aiding with the isolation that the vm module seeks to
    provide (Anna Henningsen)
    [#26497](#26497).
* C++ API
  * `AddPromiseHook` is now deprecated. This API was added to fill an use case
    that is served by `async_hooks`, since that has `Promise` support
    (Anna Henningsen) [#26529](#26529).
  * Added a `Stop` API to shut down Node.js while it is running
    (Gireesh Punathil) [#21283](#21283).
* meta
  * [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
    the Technical Steering Committee
    [#26657](#26657).
  * Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
    [#26730](#26730).

PR-URL: #26949
targos added a commit that referenced this pull request Mar 28, 2019
@targos
2019-03-28, Version 11.13.0 (Current)
2c73868
Notable changes:

* crypto
  * Allow deriving public from private keys (Tobias Nießen)
    [#26278](#26278).
* events
  * Added a `once` function to use `EventEmitter` with promises
    (Matteo Collina) [#26078](#26078).
* tty
  * Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
    [#26247](#26247).
  * Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
    [#26485](#26485).
* v8
  * Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
    in the format used by tools such as Chrome DevTools (James M Snell)
    [#26501](#26501).
* worker
  * Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
    different vm.Contexts, aiding with the isolation that the vm module seeks to
    provide (Anna Henningsen)
    [#26497](#26497).
* C++ API
  * `AddPromiseHook` is now deprecated. This API was added to fill an use case
    that is served by `async_hooks`, since that has `Promise` support
    (Anna Henningsen) [#26529](#26529).
  * Added a `Stop` API to shut down Node.js while it is running
    (Gireesh Punathil) [#21283](#21283).
* meta
  * [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
    the Technical Steering Committee
    [#26657](#26657).
  * Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
    [#26730](#26730).

PR-URL: #26949
BethGriggs pushed a commit that referenced this pull request Apr 5, 2019
@targos @BethGriggs
2019-03-28, Version 11.13.0 (Current)
473b162
Notable changes:

* crypto
  * Allow deriving public from private keys (Tobias Nießen)
    [#26278](#26278).
* events
  * Added a `once` function to use `EventEmitter` with promises
    (Matteo Collina) [#26078](#26078).
* tty
  * Added a `hasColors` method to `WriteStream` (Ruben Bridgewater)
    [#26247](#26247).
  * Added NO_COLOR and FORCE_COLOR support (Ruben Bridgewater)
    [#26485](#26485).
* v8
  * Added `v8.getHeapSnapshot` and `v8.writeHeapSnapshot` to generate snapshots
    in the format used by tools such as Chrome DevTools (James M Snell)
    [#26501](#26501).
* worker
  * Added `worker.moveMessagePortToContext`. This enables using MessagePorts in
    different vm.Contexts, aiding with the isolation that the vm module seeks to
    provide (Anna Henningsen)
    [#26497](#26497).
* C++ API
  * `AddPromiseHook` is now deprecated. This API was added to fill an use case
    that is served by `async_hooks`, since that has `Promise` support
    (Anna Henningsen) [#26529](#26529).
  * Added a `Stop` API to shut down Node.js while it is running
    (Gireesh Punathil) [#21283](#21283).
* meta
  * [Gireesh Punathil](https://github.com/gireeshpunathil) is now a member of
    the Technical Steering Committee
    [#26657](#26657).
  * Added [Yongsheng Zhang](https://github.com/ZYSzys) to collaborators
    [#26730](#26730).

PR-URL: #26949
@BethGriggs

BethGriggs commented Aug 20, 2019

Copy link
Copy Markdown
Member

@jasnell, should this land on v10.x? Please add the lts-watch label if so

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@BethGriggs BethGriggs added the dont-land-on-v10.x label Sep 3, 2019
@ggrossetie ggrossetie mentioned this pull request Sep 13, 2020
Remplacer la session MemoryStore (fuite mémoire) pour connect-mongo EcrituresNumeriques/stylo#183
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@cjihrig cjihrig cjihrig left review comments
@richardlau richardlau richardlau approved these changes
@mcollina mcollina mcollina approved these changes
@bnoordhuis bnoordhuis bnoordhuis approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
+4 more reviewers
@mscdex mscdex mscdex left review comments
@ronkorving ronkorving ronkorving left review comments
@sam-github sam-github sam-github approved these changes
@vsemozhetbyt vsemozhetbyt vsemozhetbyt approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. memory Issues and PRs related to Node.js memory management or memory footprint. semver-minor PRs that contain new features and should be released in the next minor version. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@jasnell @nodejs-github-bot @sam-github @addaleax @BethGriggs @mcollina @mscdex @bnoordhuis @ronkorving @cjihrig @joyeecheung @richardlau @vsemozhetbyt
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.