Table of Contents

Interface IMemory

Namespace
Selenium.WebDriver.BiDi.Cdp.Memory
Assembly
Selenium.WebDriver.BiDi.Cdp.dll
[Experimental("BIDICDP001")]
public interface IMemory

Methods

ForciblyPurgeJavaScriptMemoryAsync(string?, CancellationToken)

Simulate OomIntervention by purging V8 memory.

Task<ForciblyPurgeJavaScriptMemoryResult> ForciblyPurgeJavaScriptMemoryAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<ForciblyPurgeJavaScriptMemoryResult>

A task representing the asynchronous operation, containing a ForciblyPurgeJavaScriptMemoryResult.

GetAllTimeSamplingProfileAsync(string?, CancellationToken)

Retrieve native memory allocations profile collected since renderer process startup.

Task<GetAllTimeSamplingProfileResult> GetAllTimeSamplingProfileAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetAllTimeSamplingProfileResult>

A task representing the asynchronous operation, containing a GetAllTimeSamplingProfileResult.

GetBrowserSamplingProfileAsync(string?, CancellationToken)

Retrieve native memory allocations profile collected since browser process startup.

Task<GetBrowserSamplingProfileResult> GetBrowserSamplingProfileAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetBrowserSamplingProfileResult>

A task representing the asynchronous operation, containing a GetBrowserSamplingProfileResult.

GetDOMCountersAsync(string?, CancellationToken)

Retruns current DOM object counters.

Task<GetDOMCountersResult> GetDOMCountersAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetDOMCountersResult>

A task representing the asynchronous operation, containing a GetDOMCountersResult.

GetDOMCountersForLeakDetectionAsync(string?, CancellationToken)

Retruns DOM object counters after preparing renderer for leak detection.

Task<GetDOMCountersForLeakDetectionResult> GetDOMCountersForLeakDetectionAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetDOMCountersForLeakDetectionResult>

A task representing the asynchronous operation, containing a GetDOMCountersForLeakDetectionResult.

GetSamplingProfileAsync(string?, CancellationToken)

Retrieve native memory allocations profile collected since last startSampling call.

Task<GetSamplingProfileResult> GetSamplingProfileAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetSamplingProfileResult>

A task representing the asynchronous operation, containing a GetSamplingProfileResult.

PrepareForLeakDetectionAsync(string?, CancellationToken)

Prepares for leak detection by terminating workers, stopping spellcheckers, dropping non-essential internal caches, running garbage collections, etc.

Task<PrepareForLeakDetectionResult> PrepareForLeakDetectionAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<PrepareForLeakDetectionResult>

A task representing the asynchronous operation, containing a PrepareForLeakDetectionResult.

SetPressureNotificationsSuppressedAsync(bool, string?, CancellationToken)

Enable/disable suppressing memory pressure notifications in all processes.

Task<SetPressureNotificationsSuppressedResult> SetPressureNotificationsSuppressedAsync(bool suppressed, string? session = null, CancellationToken cancellationToken = default)

Parameters

suppressed bool

If true, memory pressure notifications will be suppressed.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SetPressureNotificationsSuppressedResult>

A task representing the asynchronous operation, containing a SetPressureNotificationsSuppressedResult.

SimulatePressureNotificationAsync(PressureLevel, string?, CancellationToken)

Simulate a memory pressure notification in all processes.

Task<SimulatePressureNotificationResult> SimulatePressureNotificationAsync(PressureLevel level, string? session = null, CancellationToken cancellationToken = default)

Parameters

level PressureLevel

Memory pressure level of the notification.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<SimulatePressureNotificationResult>

A task representing the asynchronous operation, containing a SimulatePressureNotificationResult.

StartSamplingAsync(long?, bool?, string?, CancellationToken)

Start collecting native memory profile.

Task<StartSamplingResult> StartSamplingAsync(long? samplingInterval = null, bool? suppressRandomness = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

samplingInterval long?

Average number of bytes between samples.

suppressRandomness bool?

Do not randomize intervals between samples.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartSamplingResult>

A task representing the asynchronous operation, containing a StartSamplingResult.

StopSamplingAsync(string?, CancellationToken)

Stop collecting native memory profile.

Task<StopSamplingResult> StopSamplingAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopSamplingResult>

A task representing the asynchronous operation, containing a StopSamplingResult.