From 440057eae048821fb8ae11313663de4fcced2cfd Mon Sep 17 00:00:00 2001 From: Gareth Ellis Date: Sat, 17 Sep 2016 10:52:26 +0100 Subject: src: extend `HeapStatistics` with new fields src: Add does_zap_garbage, malloced_memory and peak_malloced_memory to v8 HeapStatistics Following https://github.com/nodejs/code-and-learn/issues/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: https://github.com/nodejs/node/pull/8610 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- doc/api/v8.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'doc/api/v8.md') diff --git a/doc/api/v8.md b/doc/api/v8.md index 82169d0486..8cec6bdfdf 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -22,6 +22,15 @@ Returns an object with the following properties: * `total_available_size` {number} * `used_heap_size` {number} * `heap_size_limit` {number} +* `malloced_memory` {number} +* `peak_malloced_memory` {number} +* `does_zap_garbage` {number} + +`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 +continuously touches all heap pages and that makes them less likely to get +swapped out by the operating system. For example: @@ -32,7 +41,10 @@ For example: total_physical_size: 7326976, total_available_size: 1152656, used_heap_size: 3476208, - heap_size_limit: 1535115264 + heap_size_limit: 1535115264, + malloced_memory: 16384, + peak_malloced_memory: 1127496, + does_zap_garbage: 0 } ``` -- cgit v1.2.1