# V8js

Site [llms.txt](/llms.txt)

---

## V8 JS Attributes

Describes V8 JS Engine Runtime related attributes.

**Attributes:**

| Key | Stability | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- |
| <a id="v8js-gc-type" href="#v8js-gc-type">`v8js.gc.type`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The type of garbage collection. | `major`; `minor`; `incremental` [(see more)](#v8js-gc-type-values) |
| <a id="v8js-heap-space-name" href="#v8js-heap-space-name">`v8js.heap.space.name`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The name of the space type of heap memory. [1] | `new_space`; `old_space`; `code_space` [(see more)](#v8js-heap-space-name-values) |
| <a id="v8js-resource-type" href="#v8js-resource-type">`v8js.resource.type`</a> | ![Development](https://img.shields.io/badge/-development-blue) | string | The type of resource keeping the event loop active. | `Immediate`; `TCPServerWrap`; `TCPWrap` [(see more)](#v8js-resource-type-values) |

**[1] `v8js.heap.space.name`:** Value can be retrieved from value `space_name` of [`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics).
The set of reported spaces depends on the V8 version the runtime embeds.

---

<a id="v8js-gc-type-values"></a>

`v8js.gc.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `incremental` | Incremental (Incremental Marking). | ![Development](https://img.shields.io/badge/-development-blue) |
| `major` | Major (Mark Sweep Compact). | ![Development](https://img.shields.io/badge/-development-blue) |
| `minor` | Minor (Scavenge). | ![Development](https://img.shields.io/badge/-development-blue) |
| `weakcb` | Weak Callbacks (Process Weak Callbacks). | ![Development](https://img.shields.io/badge/-development-blue) |

---

<a id="v8js-heap-space-name-values"></a>

`v8js.heap.space.name` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `code_large_object_space` | Large object space for code objects. | ![Development](https://img.shields.io/badge/-development-blue) |
| `code_space` | Code memory space. | ![Development](https://img.shields.io/badge/-development-blue) |
| `large_object_space` | Large object memory space. | ![Development](https://img.shields.io/badge/-development-blue) |
| `map_space` | Map memory space. [2] | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_large_object_space` | Large object space for young-generation objects. | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_space` | New memory space. | ![Development](https://img.shields.io/badge/-development-blue) |
| `old_space` | Old memory space. | ![Development](https://img.shields.io/badge/-development-blue) |
| `read_only_space` | Read-only memory space, holding immutable objects created at startup. | ![Development](https://img.shields.io/badge/-development-blue) |
| `shared_large_object_space` | Large object space for shared objects. | ![Development](https://img.shields.io/badge/-development-blue) |
| `shared_space` | Memory space for objects shared across isolates (e.g. shared strings and structs). | ![Development](https://img.shields.io/badge/-development-blue) |
| `shared_trusted_large_object_space` | Large object space for shared trusted objects. | ![Development](https://img.shields.io/badge/-development-blue) |
| `shared_trusted_space` | Shared variant of the trusted memory space. | ![Development](https://img.shields.io/badge/-development-blue) |
| `trusted_large_object_space` | Large object space for trusted objects. | ![Development](https://img.shields.io/badge/-development-blue) |
| `trusted_space` | Memory space for trusted objects kept outside the V8 sandbox (e.g. bytecode). | ![Development](https://img.shields.io/badge/-development-blue) |

**[2]:** Only reported by Node.js <= 19; V8 merged the map space into the old space in V8 11.x.

---

<a id="v8js-resource-type-values"></a>

`v8js.resource.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
| --- | --- | --- |
| `Immediate` | Active `setImmediate` callbacks. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TCPServerWrap` | Active TCP Servers. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TCPWrap` | Active TCP connections. | ![Development](https://img.shields.io/badge/-development-blue) |
| `Timeout` | Active `setTimeout` or `setInterval` timers. | ![Development](https://img.shields.io/badge/-development-blue) |
| `TTYWrap` | Active Terminal I/O (stdin/stdout). | ![Development](https://img.shields.io/badge/-development-blue) |
