THPDFGraphTransactionStatistics 记录
对写时复制图事务栈的状态做快照:活动标志、嵌套深度、快照与新增对象计数,以及常驻、已溢出和峰值快照内存
声明
THPDFGraphTransactionStatistics= record
Active: boolean;
Depth: Integer;
SnapshotCount: Integer;
AddedObjectCount: Integer;
ResidentSnapshotBytes: Int64;
SpilledSnapshotBytes: Int64;
PeakResidentSnapshotBytes: Int64;
end;
单元
HPDFDoc
字段
| 字段 | 用途 |
|---|---|
Active | BeginGraphTransaction 打开的事务尚未关闭时为 true |
Depth | 当前栈上的嵌套事务帧数 |
SnapshotCount | 所有帧持有的写时复制对象快照 |
AddedObjectCount | 自最外层事务开始以来新增的间接对象数,以其初始对象计数为基准 |
ResidentSnapshotBytes | 所有帧当前驻留在内存中的快照字节 |
SpilledSnapshotBytes | 由溢出机制移出内存的快照字节 |
PeakResidentSnapshotBytes | 观察到的最高常驻快照总量;无活动事务时也会报告 |
使用说明
- 在
BeginGraphTransaction与CommitGraphTransaction或RollbackGraphTransaction之间,从THotPDF.GetGraphTransactionStatistics获取它,观察回滚成本的增长 Active为false时各计数器为零,只有PeakResidentSnapshotBytes保留最近一次最高水位- 用
ResidentSnapshotBytes加SpilledSnapshotBytes为大文档的长时间编辑会话规划内存预算