memory
DOMCounter
dataclass
DOM object counter data.
Source code in zendriver/cdp/memory.py
count: int
instance-attribute
name: str
instance-attribute
__init__(name, count)
from_json(json)
classmethod
Module
dataclass
Executable module information
Source code in zendriver/cdp/memory.py
base_address: str
instance-attribute
name: str
instance-attribute
size: float
instance-attribute
uuid: str
instance-attribute
__init__(name, uuid, base_address, size)
from_json(json)
classmethod
PressureLevel
Bases: Enum
Memory pressure level.
Source code in zendriver/cdp/memory.py
CRITICAL = 'critical'
class-attribute
instance-attribute
MODERATE = 'moderate'
class-attribute
instance-attribute
from_json(json)
classmethod
SamplingProfile
dataclass
Array of heap profile samples.
Source code in zendriver/cdp/memory.py
modules: typing.List[Module]
instance-attribute
samples: typing.List[SamplingProfileNode]
instance-attribute
__init__(samples, modules)
from_json(json)
classmethod
SamplingProfileNode
dataclass
Heap profile sample.
Source code in zendriver/cdp/memory.py
size: float
instance-attribute
stack: typing.List[str]
instance-attribute
total: float
instance-attribute
__init__(size, total, stack)
from_json(json)
classmethod
forcibly_purge_java_script_memory()
Simulate OomIntervention by purging V8 memory.
Source code in zendriver/cdp/memory.py
get_all_time_sampling_profile()
Retrieve native memory allocations profile collected since renderer process startup.
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SamplingProfile]
|
|
Source code in zendriver/cdp/memory.py
get_browser_sampling_profile()
Retrieve native memory allocations profile collected since browser process startup.
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SamplingProfile]
|
|
Source code in zendriver/cdp/memory.py
get_dom_counters()
Retruns current DOM object counters.
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, Tuple[int, int, int]]
|
A tuple with the following items: 0. documents - 1. nodes - 2. jsEventListeners - |
Source code in zendriver/cdp/memory.py
get_dom_counters_for_leak_detection()
Retruns DOM object counters after preparing renderer for leak detection.
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, List[DOMCounter]]
|
DOM object counters. |
Source code in zendriver/cdp/memory.py
get_sampling_profile()
Retrieve native memory allocations profile collected since last
startSampling
call.
Returns:
Type | Description |
---|---|
Generator[T_JSON_DICT, T_JSON_DICT, SamplingProfile]
|
|
Source code in zendriver/cdp/memory.py
prepare_for_leak_detection()
Prepares for leak detection by terminating workers, stopping spellcheckers, dropping non-essential internal caches, running garbage collections, etc.
Source code in zendriver/cdp/memory.py
set_pressure_notifications_suppressed(suppressed)
Enable/disable suppressing memory pressure notifications in all processes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
suppressed
|
bool
|
If true, memory pressure notifications will be suppressed. |
required |
Source code in zendriver/cdp/memory.py
simulate_pressure_notification(level)
Simulate a memory pressure notification in all processes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
level
|
PressureLevel
|
Memory pressure level of the notification. |
required |
Source code in zendriver/cdp/memory.py
start_sampling(sampling_interval=None, suppress_randomness=None)
Start collecting native memory profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling_interval
|
Optional[int]
|
(Optional) Average number of bytes between samples. |
None
|
suppress_randomness
|
Optional[bool]
|
(Optional) Do not randomize intervals between samples. |
None
|
Source code in zendriver/cdp/memory.py
stop_sampling()
Stop collecting native memory profile.