跳到主要内容

Memory🧪

✅️️ Methods

🔨Memory.forciblyPurgeJavaScriptMemory

通过清除V8内存来模拟OomIntervention。

EN
Simulate OomIntervention by purging V8 memory.

🔨Memory.getAllTimeSamplingProfile

检索自渲染器进程启动以来收集的本机内存分配配置文件。

EN
Retrieve native memory allocations profile collected since renderer process startup.
返回对象类型描述原文
profileSamplingProfile

🔨Memory.getBrowserSamplingProfile

检索自浏览器进程启动以来收集的本机内存分配配置文件。

EN
Retrieve native memory allocations profile collected since browser process startup.
返回对象类型描述原文
profileSamplingProfile

🔨Memory.getDOMCounters

返回当前DOM对象计数器。

EN
Retruns current DOM object counters.
返回对象类型描述原文
documentsinteger
nodesinteger
jsEventListenersinteger

🔨Memory.getDOMCountersForLeakDetection

在准备渲染器进行泄漏检测后,返回DOM对象计数器。

EN
Retruns DOM object counters after preparing renderer for leak detection.
返回对象类型描述原文
countersarray[DOMCounter]DOM对象计数器。
ENDOM object counters.

🔨Memory.getSamplingProfile

检索自上次 startSampling 调用以来收集的原生内存分配配置文件。

EN
Retrieve native memory allocations profile collected since last startSampling call.
返回对象类型描述原文
profileSamplingProfile

🔨Memory.prepareForLeakDetection

为泄漏检测做准备,通过终止工作线程、停止拼写检查器、清除非必要的内部缓存、运行垃圾回收等操作。

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

🔨Memory.setPressureNotificationsSuppressed

启用/禁用在所有进程中抑制内存压力通知。

EN
Enable/disable suppressing memory pressure notifications in all processes.
参数必填标记类型描述原文
suppressed✔️boolean如果为真,将抑制内存压力通知。
ENIf true, memory pressure notifications will be suppressed.

🔨Memory.simulatePressureNotification

在所有进程中模拟内存压力通知。

EN
Simulate a memory pressure notification in all processes.
参数必填标记类型描述原文
level✔️PressureLevel通知的内存压力级别。
ENMemory pressure level of the notification.

🔨Memory.startSampling

开始收集原生内存配置文件。

EN
Start collecting native memory profile.
参数必填标记类型描述原文
samplingIntervalinteger样本之间的平均字节数。
ENAverage number of bytes between samples.
suppressRandomnessboolean不要随机化样本之间的间隔。
ENDo not randomize intervals between samples.

🔨Memory.stopSampling

停止收集原生内存配置文件。

EN
Stop collecting native memory profile.

✅️️ Types

📌Memory.DOMCounter

DOM对象计数器数据。

EN
DOM object counter data.

返回类型:object

属性必填标记类型描述原文
name✔️string对象名称。注意:对象名称应被视为易变的,客户端不应期望返回的名称在不同运行间保持一致。
ENObject name. Note: object names should be presumed volatile and clients should not expect the returned names to be consistent across runs.
count✔️integer对象计数。
ENObject count.

📌Memory.Module

可执行模块信息

EN
Executable module information

返回类型:object

属性必填标记类型描述原文
name✔️string模块的名称。
ENName of the module.
uuid✔️string模块的UUID。
ENUUID of the module.
baseAddress✔️string模块加载到内存中的基址。编码为十进制或十六进制(0x 前缀)字符串。
ENBase address where the module is loaded into memory. Encoded as a decimal or hexadecimal (0x prefixed) string.
size✔️number模块的大小,以字节为单位。
ENSize of the module in bytes.

📌Memory.PressureLevel

内存压力等级。
允许值:moderatecritical

EN
Memory pressure level.
Allowed Values: moderate, critical

返回类型:string


📌Memory.SamplingProfile

堆分析样本数组。

EN
Array of heap profile samples.

返回类型:object

属性必填标记类型描述原文
samples✔️array[SamplingProfileNode]
modules✔️array[Module]

📌Memory.SamplingProfileNode

堆分析样本。

EN
Heap profile sample.

返回类型:object

属性必填标记类型描述原文
size✔️number采样的分配大小。
ENSize of the sampled allocation.
total✔️number此样本归因的总字节数。
ENTotal bytes attributed to this sample.
stack✔️array[string]分配点处的执行堆栈。
ENExecution stack at the point of allocation.