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

src: Add does_zap_garbage to v8 HeapStatistics #8610

Closed
wants to merge 1 commit into from
Closed

src: Add does_zap_garbage to v8 HeapStatistics #8610

wants to merge 1 commit into from

Conversation

gareth-ellis
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s) src, doc
Description of change

Following nodejs/code-and-learn#56 I have exposed does_zap_garbage to HeapStatistics.
The other fields, malloced_memory and peak_malloced_memory don't seem to be in the current version of v8 in master.

I have also updated the docs and test so that it matches the

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. v8 engine Issues and PRs related to the V8 dependency. labels Sep 17, 2016
@@ -22,6 +22,7 @@ Returns an object with the following properties:
* `total_available_size` {number}
* `used_heap_size` {number}
* `heap_size_limit` {number}
* `does_zap_garbage` {bool}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be {number} instead, if we're not actually returning a boolean type (true or false).

Copy link
Member

Choose a reason for hiding this comment

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

Ack, although it might be nice to have a short description here saying that this does return a 0/1 boolean.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's all that useful without explaining why it matters if garbage is getting zapped or not.

--zap_code_space makes V8 overwrite heap garbage with a bit pattern. The RSS footprint (resident memory set) gets bigger because it continuously touches all heap pages and that makes them less likely to get swapped out by the operating system.

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

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

LGTM with the requested doc change and CI of course.

Copy link
Contributor

@Fishrock123 Fishrock123 left a comment

Choose a reason for hiding this comment

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

@addaleax
Copy link
Member

The other fields, malloced_memory and peak_malloced_memory don't seem to be in the current version of v8 in master.

Yeah, I guess that counts as my bad. The other fields would come in with #8317 – Since it looks like that one is going to land soon, it seems reasonable to leave this PR open until #8317 is merged and it can be updated with all of the fields that are going to be in v7?

@gareth-ellis
Copy link
Member Author

gareth-ellis commented Sep 17, 2016

I'll keep an eye on #8317 and push the changes once that's landed and I've tested the extra two fields.

The ci run fail seems like it could be some machine issues. It'll need rerunning once the extra changes go in anyway....

@addaleax addaleax added the blocked PRs that are blocked by other issues or PRs. label Sep 17, 2016
@addaleax
Copy link
Member

I'll keep an eye on #8317 and push the changes once that's landed and I've tested the extra two fields.

Great! It should really not take long (I’m marking this as blocked for the time being).

The ci run fail seems like it could be some machine issues. It'll need rerunning once the extra changes go in anyway....

Yeah, it’s only machine issues, don’t worry about it. We’ll run CI again when this is ready. :)

@addaleax addaleax removed the blocked PRs that are blocked by other issues or PRs. label Sep 22, 2016
@addaleax
Copy link
Member

@gareth-ellis The other fields are available on master now, so this should no longer be blocked. \o/

@gareth-ellis
Copy link
Member Author

Updated to reflect the new fields being added to v8. ptal

@addaleax addaleax added the semver-minor PRs that contain new features and should be released in the next minor version. label Sep 22, 2016
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

CI: https://ci.nodejs.org/job/node-test-commit/5244/

LGTM if it’s green. It would be ideal if you could use a one-line commit subject, e.g. v8: extend HeapStatistics with new fields?

@gareth-ellis
Copy link
Member Author

Done, I kept src as the subsystem, hope that's ok

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

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

LGTM with nits.

* `peak_malloced_memory` {number}
* `does_zap_garbage` {number}

does_zap_garbage is a 0/1 boolean, which signifies whether the zap_code_space
Copy link
Member

@bnoordhuis bnoordhuis Sep 23, 2016

Choose a reason for hiding this comment

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

Can you put does_zap_garbage and zap_code_space between backticks and put two dashes before the latter? People will have a hard time guessing it's a command line switch otherwise.


does_zap_garbage is a 0/1 boolean, which signifies whether the zap_code_space
option is enabled or not. This makes V8 overwrite heap garbage with a bit
pattern. The RSS footprint (resident memory set) gets bigger because it
Copy link
Member

Choose a reason for hiding this comment

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

Nit: no initial space.

src: Add does_zap_garbage, malloced_memory and
peak_malloced_memory to v8 HeapStatistics

Following nodejs/code-and-learn#56 I
have exposed does_zap_garbage to HeapStatistics.
The other fields, malloced_memory and peak_malloced_memory don't
seem to be in the current version of v8 in master.
@gareth-ellis
Copy link
Member Author

Made changes to address @bnoordhuis 's comments

@jasnell
Copy link
Member

jasnell commented Oct 6, 2016

@jasnell jasnell self-assigned this Oct 6, 2016
@jasnell
Copy link
Member

jasnell commented Oct 7, 2016

Last CI was too red, trying again: https://ci.nodejs.org/job/node-test-pull-request/4425/

@addaleax
Copy link
Member

addaleax commented Oct 7, 2016

CI was green except for FreeBSD, so here’s one more try: https://ci.nodejs.org/job/node-test-commit/5503/

@gareth-ellis
Copy link
Member Author

Seems the freebsd failiure is three timeouts. However, it seems to be failing more often than not

@rvagg rvagg force-pushed the master branch 2 times, most recently from c133999 to 83c7a88 Compare October 18, 2016 17:02
@addaleax
Copy link
Member

Sorry this got a bit lost, new CI: https://ci.nodejs.org/job/node-test-commit/6092/

@addaleax
Copy link
Member

Landed in 440057e, thanks for the PR!

@addaleax addaleax closed this Nov 20, 2016
addaleax pushed a commit that referenced this pull request Nov 20, 2016
src: Add does_zap_garbage, malloced_memory and
peak_malloced_memory to v8 HeapStatistics

Following nodejs/code-and-learn#56 I
have exposed does_zap_garbage to HeapStatistics.
The other fields, malloced_memory and peak_malloced_memory don't
seem to be in the current version of v8 in master.

PR-URL: #8610
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
addaleax pushed a commit that referenced this pull request Nov 22, 2016
src: Add does_zap_garbage, malloced_memory and
peak_malloced_memory to v8 HeapStatistics

Following nodejs/code-and-learn#56 I
have exposed does_zap_garbage to HeapStatistics.
The other fields, malloced_memory and peak_malloced_memory don't
seem to be in the current version of v8 in master.

PR-URL: #8610
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@Fishrock123 Fishrock123 mentioned this pull request Nov 22, 2016
2 tasks
Fishrock123 added a commit that referenced this pull request Nov 22, 2016
Notable changes:

* crypto: The `Decipher` methods `setAuthTag()` and `setAAD` now return
`this`. (Kirill Fomichev) #9398
* dns: Implemented `{ttl: true}` for `resolve4()` and `resolve6()`.
(Ben Noordhuis) #9296 &
#9296
* libuv: Upgrade to v1.10.1 (cjihrig)
#9647
* process: Added a new `external` property to the data returned by
`memoryUsage()`. (Fedor Indutny)
#9587
* V8 (dep): Upgrade to v5.4.500.43 (Michaël Zasso)
#9697
* v8: The data returned by `getHeapStatistics()` now includes three new
fields: `malloced_memory`, `peak_malloced_memory`, and
`does_zap_garbage`. (Gareth Ellis)
#8610

PR-URL: #9745
Fishrock123 added a commit that referenced this pull request Nov 22, 2016
This is a security release impacting Windows 10 users.

Notable changes:

* crypto: The `Decipher` methods `setAuthTag()` and `setAAD` now return
`this`. (Kirill Fomichev) #9398
* dns: Implemented `{ttl: true}` for `resolve4()` and `resolve6()`.
(Ben Noordhuis) #9296 &
#9296
* libuv: Upgrade to v1.10.1 (cjihrig)
#9647
  - Fixed a potential buffer overflow when writing data to console on
Windows 10. (CVE-2016-9551)
* process: Added a new `external` property to the data returned by
`memoryUsage()`. (Fedor Indutny)
#9587
* tls: Fixed a memory leak when writes were queued on TLS connection
that was destroyed during handshake. (Fedor Indutny)
#9626
* V8 (dep): Upgrade to v5.4.500.43 (Michaël Zasso)
#9697
* v8: The data returned by `getHeapStatistics()` now includes three new
fields: `malloced_memory`, `peak_malloced_memory`, and
`does_zap_garbage`. (Gareth Ellis)
#8610

PR-URL: #9745
Fishrock123 added a commit that referenced this pull request Nov 22, 2016
This is a security release impacting Windows 10 users.

Notable changes:

* crypto: The `Decipher` methods `setAuthTag()` and `setAAD` now return
`this`. (Kirill Fomichev) #9398
* dns: Implemented `{ttl: true}` for `resolve4()` and `resolve6()`.
(Ben Noordhuis) #9296 &
#9296
* libuv: Upgrade to v1.10.1 (cjihrig)
#9647
  - Fixed a potential buffer overflow when writing data to console on
Windows 10. (CVE-2016-9551)
* process: Added a new `external` property to the data returned by
`memoryUsage()`. (Fedor Indutny)
#9587
* tls: Fixed a memory leak when writes were queued on TLS connection
that was destroyed during handshake. (Fedor Indutny)
#9626
* V8 (dep): Upgrade to v5.4.500.43 (Michaël Zasso)
#9697
* v8: The data returned by `getHeapStatistics()` now includes three new
fields: `malloced_memory`, `peak_malloced_memory`, and
`does_zap_garbage`. (Gareth Ellis)
#8610

PR-URL: #9745
imyller added a commit to imyller/meta-nodejs that referenced this pull request Nov 28, 2016
This is a security release impacting Windows 10 users.

    Notable changes:

    * crypto: The `Decipher` methods `setAuthTag()` and `setAAD` now return
    `this`. (Kirill Fomichev) nodejs/node#9398
    * dns: Implemented `{ttl: true}` for `resolve4()` and `resolve6()`.
    (Ben Noordhuis) nodejs/node#9296 &
    nodejs/node#9296
    * libuv: Upgrade to v1.10.1 (cjihrig)
    nodejs/node#9647
      - Fixed a potential buffer overflow when writing data to console on
    Windows 10. (CVE-2016-9551)
    * process: Added a new `external` property to the data returned by
    `memoryUsage()`. (Fedor Indutny)
    nodejs/node#9587
    * tls: Fixed a memory leak when writes were queued on TLS connection
    that was destroyed during handshake. (Fedor Indutny)
    nodejs/node#9626
    * V8 (dep): Upgrade to v5.4.500.43 (Michaël Zasso)
    nodejs/node#9697
    * v8: The data returned by `getHeapStatistics()` now includes three new
    fields: `malloced_memory`, `peak_malloced_memory`, and
    `does_zap_garbage`. (Gareth Ellis)
    nodejs/node#8610

Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. semver-minor PRs that contain new features and should be released in the next minor version. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants