Skip to main content

说明

来自 jemalloc 堆内存剖析器 的每个存活的采样分配 (sampled allocation) 对应一行;读取该表会刷写一份新的堆内存剖析。只有启用了 profiler 的线程才会贡献数据 (通过 jemalloc_enable_profiler SETTING 或 jemalloc_enable_global_profiler config) ;每行大致代表 weight 个类似的分配。

列

  • trace (Array(UInt64)) — 分配调用栈的地址,叶子 (leaf) 栈帧在前 (与 system.trace_log.trace 的约定一致) 。可使用 addressToSymbol 和 demangle 进行符号化 (需要 allow_introspection_functions) 。
  • age_ns (UInt64) — 该次分配已存活的时间 (纳秒) ,相对于 profile 被刷写的时刻计算。
  • size (UInt64) — 请求的分配大小,单位为字节。
  • usize (UInt64) — 可用大小 (字节) ,即该请求被向上取整到的大小类。
  • size_class (UInt16) — 大小类的索引。对于较小的大小类,可与 system.jemalloc_bins.index 进行 join。
  • arena (UInt32) — 提供本次分配的 arena 的索引。
  • thr_uid (UInt64) — 执行分配的线程在 jemalloc 内部的唯一 id。
  • sample_interval (UInt64) — 两次采样之间平均分配的字节数,取自 profile 的头部信息。所有行的该值相同。
别名:
  • alloc_time — now() - intDiv(age_ns, 1000000000) 的别名。
  • weight — 1 / (1 - exp((-usize) / sample_interval)) 的别名。
最后修改于 2026年9月28日