summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorYuriy Vasiyarov <yvasiyarov@ozon.travel>2019-05-28 13:41:12 +0300
committerRich Trott <rtrott@gmail.com>2019-05-30 15:25:55 +0200
commita40aae8d1bd8e6d292cdfb20a59b101981673334 (patch)
tree0df392b2c9fa8bf66c30eab6d5394b3acb87416e /doc
parentafb84744c6071e77f0738a7ff1a52aaa81db8b77 (diff)
downloadandroid-node-v8-a40aae8d1bd8e6d292cdfb20a59b101981673334.tar.gz
android-node-v8-a40aae8d1bd8e6d292cdfb20a59b101981673334.tar.bz2
android-node-v8-a40aae8d1bd8e6d292cdfb20a59b101981673334.zip
src: export number_of_native_contexts and number_of_detached_contexts
export number_of_native_contexts and number_of_detached_contexts as part of v8.getHeapStatistics() PR-URL: https://github.com/nodejs/node/pull/27933 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/v8.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/doc/api/v8.md b/doc/api/v8.md
index 9949720cf6..ab5950dda6 100644
--- a/doc/api/v8.md
+++ b/doc/api/v8.md
@@ -131,6 +131,9 @@ Returns an object with the following properties:
* `malloced_memory` {number}
* `peak_malloced_memory` {number}
* `does_zap_garbage` {number}
+* `number_of_native_contexts` {number}
+* `number_of_detached_contexts` {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
@@ -138,6 +141,14 @@ 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.
+`number_of_native_contexts` The value of native_context is the number of the
+top-level contexts currently active. Increase of this number over time indicates
+a memory leak.
+
+`number_of_detached_contexts` The value of detached_context is the number
+of contexts that were detached and not yet garbage collected. This number
+being non-zero indicates a potential memory leak.
+
<!-- eslint-skip -->
```js
{
@@ -149,7 +160,9 @@ to get swapped out by the operating system.
heap_size_limit: 1535115264,
malloced_memory: 16384,
peak_malloced_memory: 1127496,
- does_zap_garbage: 0
+ does_zap_garbage: 0,
+ number_of_native_contexts: 1,
+ number_of_detached_contexts: 0
}
```