Memory
本页面介绍 Lynx DevTool 支持的 Memory CDP domain。
实验性参考
此生成的参考文档仍在完善中。
- CDP events 尚未包含。
- 部分 Lynx 扩展已列出,但尚未提供详细文档。
- 方法说明尚未根据实现自动校验,可能不完整或不准确。
在依赖本参考前,请根据实现及所链接的 upstream CDP reference 验证实际行为。
概览
- 作用域:
global-and-instance - CDP domain:Memory
Lynx 扩展
Memory.getAllMemoryUsage
Queries global Lynx-attributed memory usage across live registered Lynx instances.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_memory_agent.cc
参数
返回字段
备注
- Send this method to the global DevTool handler with session ID -1.
- The mediator validates params.timeoutMs before dispatch. Non-object params, non-integer timeoutMs, negative timeoutMs, and timeoutMs values greater than 300000 return CDP errors.
- The platform bridge returns only the result object as JSON. The mediator parses that object and wraps it in the CDP response envelope with the original request id.
- Runtimes without a platform memory bridge return a CDP error instead of a partial memory result.
- This method differs from Runtime.getHeapUsage, which reports JavaScript heap usage for one target runtime.
示例
Use the platform default timeout
Request:
Use an explicit timeout
Request:
Memory.startTracing
Starts platform memory tracing for Lynx memory diagnostics.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_memory_agent.cc
参数
无参数。
返回字段
备注
- Use the global DevTool handler with session ID -1 when controlling app-wide memory tracing.
- Dispatches through LynxGlobalDevToolMediator to GlobalDevToolPlatformFacade.StartMemoryTracing.
- Android and Darwin register the DevTool memory controller as a platform memory reporter.
- The generic embedder implementation is a no-op until the embedder supplies a memory bridge.
示例
Start memory tracing
Request:
Response:
Memory.stopTracing
Stops platform memory tracing for Lynx memory diagnostics.
- Origin:
lynx-extension - Source:
devtool/lynx_devtool/agent/domain_agent/inspector_memory_agent.cc
参数
无参数。
返回字段
备注
- Use the global DevTool handler with session ID -1 when controlling app-wide memory tracing.
- Dispatches through LynxGlobalDevToolMediator to GlobalDevToolPlatformFacade.StopMemoryTracing.
- Android and Darwin unregister the DevTool memory controller from platform memory reporting.
- The generic embedder implementation is a no-op until the embedder supplies a memory bridge.
示例
Stop memory tracing
Request:
Response: