| | |
| | | /** |
| | | * The `node:v8` module exposes APIs that are specific to the version of [V8](https://developers.google.com/v8/) built into the Node.js binary. It can be accessed using: |
| | | * |
| | | * ```js |
| | | * import v8 from 'node:v8'; |
| | | * ``` |
| | | * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/v8.js) |
| | | */ |
| | | declare module "node:v8" { |
| | | import { NonSharedBuffer } from "node:buffer"; |
| | | import { Readable } from "node:stream"; |
| | |
| | | total_global_handles_size: number; |
| | | used_global_handles_size: number; |
| | | external_memory: number; |
| | | total_allocated_bytes: number; |
| | | } |
| | | interface HeapCodeStatistics { |
| | | code_and_metadata_size: number; |
| | |
| | | * `external_memory` The value of external\_memory is the memory size of array |
| | | * buffers and external strings. |
| | | * |
| | | * `total_allocated_bytes` The value of total allocated bytes since the Isolate |
| | | * creation. |
| | | * |
| | | * ```js |
| | | * { |
| | | * total_heap_size: 7326976, |
| | |
| | | * number_of_detached_contexts: 0, |
| | | * total_global_handles_size: 8192, |
| | | * used_global_handles_size: 3296, |
| | | * external_memory: 318824 |
| | | * external_memory: 318824, |
| | | * total_allocated_bytes: 45224088 |
| | | * } |
| | | * ``` |
| | | * @since v1.0.0 |
| | |
| | | * ``` |
| | | * @param ctor The constructor that can be used to search on the prototype chain in order to filter target objects in the heap. |
| | | * @since v20.13.0 |
| | | * @experimental |
| | | */ |
| | | function queryObjects(ctor: Function): number | string[]; |
| | | function queryObjects(ctor: Function, options: { format: "count" }): number; |
| | |
| | | * ``` |
| | | * @since v25.0.0 |
| | | */ |
| | | function startCPUProfile(): SyncCPUProfileHandle; |
| | | function startCpuProfile(): SyncCPUProfileHandle; |
| | | /** |
| | | * V8 only supports `Latin-1/ISO-8859-1` and `UTF16` as the underlying representation of a string. |
| | | * If the `content` uses `Latin-1/ISO-8859-1` as the underlying representation, this function will return true; |
| | |
| | | * @since v19.6.0, v18.15.0 |
| | | */ |
| | | stop(): GCProfilerResult; |
| | | /** |
| | | * Stop collecting GC data, and discard the profile. |
| | | * @since v25.5.0 |
| | | */ |
| | | [Symbol.dispose](): void; |
| | | } |
| | | interface GCProfilerResult { |
| | | version: number; |