RuntimeConfig
Configuration for JavaScript runtime instances.
Use this to configure heap limits, execution timeouts, and bootstrap scripts before creating a Runtime.
__init__
__init__(max_heap_size: int | None = None, initial_heap_size: int | None = None, bootstrap: str | None = None, timeout: float | int | None = None, enable_console: bool | None = False, inspector: InspectorConfig | None = None, snapshot: bytes | None = None, max_serialization_depth: int | None = None, max_serialization_bytes: int | None = None) -> None
Create a new runtime configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_heap_size
|
int | None
|
Maximum heap size in bytes |
None
|
initial_heap_size
|
int | None
|
Initial heap size in bytes |
None
|
bootstrap
|
str | None
|
JavaScript source code to execute on startup |
None
|
timeout
|
float | int | None
|
Execution timeout in seconds (float or int) |
None
|
enable_console
|
bool | None
|
Whether |
False
|
inspector
|
InspectorConfig | None
|
Optional inspector configuration enabling Chrome DevTools |
None
|
snapshot
|
bytes | None
|
Optional V8 startup snapshot bytes |
None
|
max_serialization_depth
|
int | None
|
Maximum nesting depth when transferring values |
None
|
max_serialization_bytes
|
int | None
|
Maximum serialized byte size when transferring values |
None
|
enable_console
property
Whether console APIs are enabled inside the runtime.
inspector
property
writable
inspector: InspectorConfig | None
Inspector configuration if debugging is enabled.
max_serialization_depth
property
writable
Maximum recursion depth allowed when serializing values.