Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.159.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package memory provides the Chrome DevTools Protocol commands, types, and events for the Memory domain.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandGetDOMCounters                     = "Memory.getDOMCounters"
	CommandGetDOMCountersForLeakDetection     = "Memory.getDOMCountersForLeakDetection"
	CommandPrepareForLeakDetection            = "Memory.prepareForLeakDetection"
	CommandForciblyPurgeJavaScriptMemory      = "Memory.forciblyPurgeJavaScriptMemory"
	CommandSetPressureNotificationsSuppressed = "Memory.setPressureNotificationsSuppressed"
	CommandSimulatePressureNotification       = "Memory.simulatePressureNotification"
	CommandStartSampling                      = "Memory.startSampling"
	CommandStopSampling                       = "Memory.stopSampling"
	CommandGetAllTimeSamplingProfile          = "Memory.getAllTimeSamplingProfile"
	CommandGetBrowserSamplingProfile          = "Memory.getBrowserSamplingProfile"
	CommandGetSamplingProfile                 = "Memory.getSamplingProfile"
)

Command names.

Variables

View Source
var ForciblyPurgeJavaScriptMemory = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandForciblyPurgeJavaScriptMemory}

ForciblyPurgeJavaScriptMemory simulate OomIntervention by purging V8 memory.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-forciblyPurgeJavaScriptMemory

GetAllTimeSamplingProfile retrieve native memory allocations profile collected since renderer process startup.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getAllTimeSamplingProfile

GetBrowserSamplingProfile retrieve native memory allocations profile collected since browser process startup.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getBrowserSamplingProfile

GetDOMCounters retruns current DOM object counters.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getDOMCounters

GetDOMCountersForLeakDetection retruns DOM object counters after preparing renderer for leak detection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getDOMCountersForLeakDetection

GetSamplingProfile retrieve native memory allocations profile collected since last startSampling call.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getSamplingProfile

View Source
var PrepareForLeakDetection = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandPrepareForLeakDetection}

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

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-prepareForLeakDetection

SetPressureNotificationsSuppressed enable/disable suppressing memory pressure notifications in all processes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-setPressureNotificationsSuppressed

SimulatePressureNotification simulate a memory pressure notification in all processes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-simulatePressureNotification

StartSampling start collecting native memory profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-startSampling

View Source
var StopSampling = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandStopSampling}

StopSampling stop collecting native memory profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-stopSampling

Functions

This section is empty.

Types

type DOMCounter

type DOMCounter struct {
	Name  string `json:"name"`  // Object name. Note: object names should be presumed volatile and clients should not expect the returned names to be consistent across runs.
	Count int64  `json:"count"` // Object count.
}

DOMCounter DOM object counter data.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-DOMCounter

type GetAllTimeSamplingProfileResult added in v0.157.3

type GetAllTimeSamplingProfileResult struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetAllTimeSamplingProfileResult is the result of the command Memory.getAllTimeSamplingProfile.

type GetBrowserSamplingProfileResult added in v0.157.3

type GetBrowserSamplingProfileResult struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetBrowserSamplingProfileResult is the result of the command Memory.getBrowserSamplingProfile.

type GetDOMCountersForLeakDetectionResult added in v0.157.3

type GetDOMCountersForLeakDetectionResult struct {
	Counters []*DOMCounter `json:"counters,omitempty,omitzero"` // DOM object counters.
}

GetDOMCountersForLeakDetectionResult is the result of the command Memory.getDOMCountersForLeakDetection.

type GetDOMCountersResult added in v0.157.3

type GetDOMCountersResult struct {
	Documents        int64 `json:"documents,omitempty,omitzero"`
	Nodes            int64 `json:"nodes,omitempty,omitzero"`
	JsEventListeners int64 `json:"jsEventListeners,omitempty,omitzero"`
}

GetDOMCountersResult is the result of the command Memory.getDOMCounters.

type GetSamplingProfileResult added in v0.157.3

type GetSamplingProfileResult struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetSamplingProfileResult is the result of the command Memory.getSamplingProfile.

type Module

type Module struct {
	Name        string  `json:"name"`        // Name of the module.
	UUID        string  `json:"uuid"`        // UUID of the module.
	BaseAddress string  `json:"baseAddress"` // Base address where the module is loaded into memory. Encoded as a decimal or hexadecimal (0x prefixed) string.
	Size        float64 `json:"size"`        // Size of the module in bytes.
}

Module executable module information.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-Module

type PressureLevel

type PressureLevel string

PressureLevel memory pressure level.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-PressureLevel

const (
	PressureLevelModerate PressureLevel = "moderate"
	PressureLevelCritical PressureLevel = "critical"
)

PressureLevel values.

func (PressureLevel) String

func (t PressureLevel) String() string

String returns the PressureLevel as string value.

type SamplingProfile

type SamplingProfile struct {
	Samples []*SamplingProfileNode `json:"samples"`
	Modules []*Module              `json:"modules"`
}

SamplingProfile array of heap profile samples.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-SamplingProfile

type SamplingProfileNode

type SamplingProfileNode struct {
	Size  float64  `json:"size"`  // Size of the sampled allocation.
	Total float64  `json:"total"` // Total bytes attributed to this sample.
	Stack []string `json:"stack"` // Execution stack at the point of allocation.
}

SamplingProfileNode heap profile sample.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-SamplingProfileNode

type SetPressureNotificationsSuppressedParams

type SetPressureNotificationsSuppressedParams struct {
	Suppressed bool `json:"suppressed"` // If true, memory pressure notifications will be suppressed.
}

SetPressureNotificationsSuppressedParams are the parameters of the command Memory.setPressureNotificationsSuppressed.

type SimulatePressureNotificationParams

type SimulatePressureNotificationParams struct {
	Level PressureLevel `json:"level"` // Memory pressure level of the notification.
}

SimulatePressureNotificationParams are the parameters of the command Memory.simulatePressureNotification.

type StartSamplingParams

type StartSamplingParams struct {
	SamplingInterval   int64 `json:"samplingInterval,omitempty,omitzero"`   // Average number of bytes between samples.
	SuppressRandomness *bool `json:"suppressRandomness,omitempty,omitzero"` // Do not randomize intervals between samples.
}

StartSamplingParams are the parameters of the command Memory.startSampling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL