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.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| profile | SamplingProfile |
🔨Memory.getBrowserSamplingProfile
检索自浏览器进程启动以来收集的本机内存分配配置文件。
EN
Retrieve native memory allocations profile collected since browser process startup.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| profile | SamplingProfile |
🔨Memory.getDOMCounters
返回当前DOM对象计数器。
EN
Retruns current DOM object counters.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| documents | integer | ||
| nodes | integer | ||
| jsEventListeners | integer |
🔨Memory.getDOMCountersForLeakDetection
在准备渲染器进行泄漏检测后,返回DOM对象计数器。
EN
Retruns DOM object counters after preparing renderer for leak detection.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| counters | array[DOMCounter] | DOM对象计数器。 | ENDOM object counters. |
🔨Memory.getSamplingProfile
检索自上次 startSampling 调用以来收集的原生内存分配配置文件。
EN
Retrieve native memory allocations profile collected since last
startSampling call.| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| profile | SamplingProfile |
🔨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.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| samplingInterval | integer | 样本之间的平均字节数。 | ENAverage number of bytes between samples. | ||
| suppressRandomness | boolean | 不要随机化样本之间的间隔。 | 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
内存压力等级。
允许值:moderate、critical
EN
Memory pressure level.
Allowed Values:
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. |