mdbctl snapshot 命令介绍
更新时间:2025/10/15
在Gitcode上查看源码mdbctl snapshot 命令介绍
mdbctl提供公共命令snapshot,用于生成当前或增长内存对象的快照,帮助分析进程内存空间分布信息。快照文件存储路径分别为/dev/shm/snapshot_组件名和/dev/shm/snapshotdiff_组件名。
1. 命令介绍
snapshot <operation type>
参数说明:
operation type:必选参数,操作模式。start:生成当前内存对象的快照。diff:生成与上一次快照对比的增长内存对象的快照。
2. 使用示例
shell
% attach maca
Success
% help
Usage: snapshot <operation type>
generate the snapshot of the memory object.
operation type: start/diff.
note: this operation may cause memory consumption.
# 生成当前内存对象的快照
% snapshot start
snapshot file: /dev/shm/snapshot_maca
notice: this operation may cause memory consumption.
# 生成与上一次生成内存对象增长对比的快照
% snapshot diff
diff snapshot file: /dev/shm/snapshotdiff_maca
notice: this operation may cause memory consumption.3. 注意事项
- mdbctl ≥ 1.20.10支持mdbctl snapshot命令。
- 调用该命令时可能会导致内存消耗。