Skip to content

[macos][内存] footprint 阶梯式增长:每个听写时段约 +1.5GB 且不回收(闲置不涨;1.3.18 / macOS 27.0.1) #1166

Open

Description

@solodddd

TL;DR (EN): On stable v1.3.18 (macOS 27.0.1, M1 Max), phys_footprint steps up by ~1.55 GB per dictation episode and is never released (4 consecutive steps observed; step size ≈ the bundled local ASR model size). During 6+ hours of complete idleness the footprint stays absolutely flat. A previous long-running instance reached 17GB → 25GB within about one day of heavy use; restarting resets it to ~40 MB.

环境

  • OpenLess 1.3.18(stable;brew cask 安装;ad-hoc 签名构建)
  • macOS 27.0.1 (26A434),MacBook Pro 16" M1 Max,64GB
  • 本地 ASR:whisper-large-v3-turbo(ggml-large-v3-turbo.bin,1.5GB);听写为主要使用方式
  • 观测方式:footprint -p / vmmap -summary / sample;每 5 分钟自动采样(完整 CSV 可提供)

实验 A:重启后正常使用(每 5 分钟采样,全程未重启)

时间 (+08) phys_footprint 说明
01:37 39 MB 重启
01:59 1629 MB ← 听写时段①(01:49 起,3 条记录)台阶 +1590MB
02:42 3183 MB ← 听写时段②(02:42–02:46,4 条记录)台阶 +1554MB
02:47 – 09:17 3275 MB 整机闲置 6 小时:0 增长(区域数亦不变)
09:48 4835 MB ← 听写时段③(09:47,1 条记录)台阶 +1560MB
10:06 6393 MB ← 听写时段④(10:06,1 条记录)台阶 +1558MB
  • 4 个台阶 ≈ +1.55GB,全部落在匿名脏页区(Untagged,区域数 123 → 144 → 147 → 163 → 183)。
  • 台阶尺寸 ≈ 本地模型文件体积(1.5GB)→ 猜测(待核实):每次听写时段(重新)加载 1.5GB 级的模型/缓冲区,结束后未释放。
  • 排除项:IOAccelerator (graphics) 仅 4.7MB(非 GPU);lsof 无模型文件句柄、mapped file 区域很小(非文件映射常驻);主线程空闲于 mach_msg(非活跃计算)。

实验 B:长跑累计(重启前的另一实例,约 26 小时)

时间 phys_footprint
10/8 23:41 17.0 GB
10/9 00:42 23.0 GB
10/9 01:28 25.0 GB(重启前最终)

重启后回到 39MB,随后按实验 A 重新阶梯式累积(当前仍在持续)。Activity Monitor 显示 16.97GB+(与 footprint 口径一致)。

复现步骤

  1. 重启 app(footprint ≈ 40MB)。
  2. 正常使用听写几次(间隔性),其间可长时间闲置。
  3. 每 5 分钟 footprint -p <pid>:闲置不变;每次听写时段后出现约 +1.5GB 台阶且不回落。

期望

希望定位每个听写时段约 1.5GB 的累积(疑似本地 ASR 模型/缓冲重复加载未释放)。如需更多诊断(malloc 历史、debug 构建、更多采样)我可以配合。另请问:v2.0.0 Beta 是否已包含相关修复?

Activity

  1. solodddd commented on Oct 11, 2026

    @solodddd
    Author

    更新(2026-10-11):该问题在 stable 1.3.18 上稳定复现,补充更长期的数据。

    • 同一实例(10/9 重启)连续运行 2.5 天:phys_footprint 从 ~40MB → 46 GB(几乎全部为 Untagged 匿名区,约 620 个区块);期间听写约 60 次(10/9–10/11 依次 30 / 15 / 14 条记录)。
    • 其中 20 小时做了 5 分钟粒度的完整采样:形态与首帖一致——闲置时段零增长;每个听写时段出现 ~+1.5GB 台阶、永不回落(0.04GB → 15GB)。完整 CSV 可提供。
    • 系统级代价已很明显:本机内存压缩器 35GB、swap 36.9GB/37.9GB 用满。
    • 环境不变:OpenLess 1.3.18 (stable) / macOS 27.0.1 / M1 Max。

    想跟进一下:

    1. 你们能否复现?是否已排入计划、预期在哪个版本修复(v2.0.0 是否覆盖)?
    2. 需要的话我可以提供完整数据、在候选修复构建上做对照验证,或按你们要求的任何格式补充采集。
    3. 若需要从内部定位(模型/缓冲的生命周期),也欢迎告诉我怎么配合最省你们的事。

    谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions