Table of Contents

Class MemoryAdapter

Namespace
OpenQA.Selenium.DevTools.V146.Memory
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Memory domain to simplify the command interface.

public class MemoryAdapter
Inheritance
MemoryAdapter
Inherited Members

Constructors

MemoryAdapter(IDevToolsSession)

Initializes a new instance of the MemoryAdapter class.

public MemoryAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

ForciblyPurgeJavaScriptMemory(ForciblyPurgeJavaScriptMemoryCommandSettings?, CancellationToken, int?, bool)

Simulate OomIntervention by purging V8 memory.

public Task<ForciblyPurgeJavaScriptMemoryCommandResponse?> ForciblyPurgeJavaScriptMemory(ForciblyPurgeJavaScriptMemoryCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command ForciblyPurgeJavaScriptMemoryCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<ForciblyPurgeJavaScriptMemoryCommandResponse>

GetAllTimeSamplingProfile(GetAllTimeSamplingProfileCommandSettings?, CancellationToken, int?, bool)

Retrieve native memory allocations profile collected since renderer process startup.

public Task<GetAllTimeSamplingProfileCommandResponse> GetAllTimeSamplingProfile(GetAllTimeSamplingProfileCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetAllTimeSamplingProfileCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetAllTimeSamplingProfileCommandResponse>

GetBrowserSamplingProfile(GetBrowserSamplingProfileCommandSettings?, CancellationToken, int?, bool)

Retrieve native memory allocations profile collected since browser process startup.

public Task<GetBrowserSamplingProfileCommandResponse> GetBrowserSamplingProfile(GetBrowserSamplingProfileCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetBrowserSamplingProfileCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetBrowserSamplingProfileCommandResponse>

GetDOMCounters(GetDOMCountersCommandSettings?, CancellationToken, int?, bool)

Retruns current DOM object counters.

public Task<GetDOMCountersCommandResponse> GetDOMCounters(GetDOMCountersCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetDOMCountersCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetDOMCountersCommandResponse>

GetDOMCountersForLeakDetection(GetDOMCountersForLeakDetectionCommandSettings?, CancellationToken, int?, bool)

Retruns DOM object counters after preparing renderer for leak detection.

public Task<GetDOMCountersForLeakDetectionCommandResponse> GetDOMCountersForLeakDetection(GetDOMCountersForLeakDetectionCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetDOMCountersForLeakDetectionCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetDOMCountersForLeakDetectionCommandResponse>

GetSamplingProfile(GetSamplingProfileCommandSettings?, CancellationToken, int?, bool)

Retrieve native memory allocations profile collected since last startSampling call.

public Task<GetSamplingProfileCommandResponse> GetSamplingProfile(GetSamplingProfileCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetSamplingProfileCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetSamplingProfileCommandResponse>

PrepareForLeakDetection(PrepareForLeakDetectionCommandSettings?, CancellationToken, int?, bool)

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

public Task<PrepareForLeakDetectionCommandResponse?> PrepareForLeakDetection(PrepareForLeakDetectionCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command PrepareForLeakDetectionCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<PrepareForLeakDetectionCommandResponse>

SetPressureNotificationsSuppressed(SetPressureNotificationsSuppressedCommandSettings, CancellationToken, int?, bool)

Enable/disable suppressing memory pressure notifications in all processes.

public Task<SetPressureNotificationsSuppressedCommandResponse?> SetPressureNotificationsSuppressed(SetPressureNotificationsSuppressedCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetPressureNotificationsSuppressedCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetPressureNotificationsSuppressedCommandResponse>

SimulatePressureNotification(SimulatePressureNotificationCommandSettings, CancellationToken, int?, bool)

Simulate a memory pressure notification in all processes.

public Task<SimulatePressureNotificationCommandResponse?> SimulatePressureNotification(SimulatePressureNotificationCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SimulatePressureNotificationCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SimulatePressureNotificationCommandResponse>

StartSampling(StartSamplingCommandSettings, CancellationToken, int?, bool)

Start collecting native memory profile.

public Task<StartSamplingCommandResponse?> StartSampling(StartSamplingCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartSamplingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartSamplingCommandResponse>

StopSampling(StopSamplingCommandSettings?, CancellationToken, int?, bool)

Stop collecting native memory profile.

public Task<StopSamplingCommandResponse?> StopSampling(StopSamplingCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopSamplingCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopSamplingCommandResponse>