diff --git a/doc/api/v8.md b/doc/api/v8.md index 4ed65dc2b45222..2dc33a3f5b45d8 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -232,6 +232,27 @@ buffers and external strings. } ``` +## `v8.getIsolateAddress()` + + + +> Stability: 1 - Experimental + +* Returns: {string} + +The address of the V8 Isolate corresponding to the current [worker +thread][worker threads]. You can add this to your application-level logs +lines to correlate it with the `--trace_gc` log lines output by V8. The +exact format of this identifier is platform-dependent. + +This identifier is stable while the current worker thread is executing. +However the address may be reused by other threads after this worker +thread stops. See [`require('node:worker_threads').threadId`][] for an +identifier which is guaranteed not to be reused over the process's +lifetime. + ## `v8.setFlagsFromString(flags)`