Repository navigation
dsh web 页面每次刷新泄漏约 45 MB,不回收 #6998
xie-zhichao
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
dsh web 页面每次刷新泄漏约 45 MB,不回收
概述
dsh web的浏览器页面每刷新一次,渲染进程就多占约 45 MB 且不再释放,随刷新次数线性增长,没有收敛迹象。20 次刷新后进程从 186 MB 涨到 1125 MB。泄漏的不是 JS 堆(Web Inspector 里 JavaScript 分类最高 251 MB 且会回落),而是引擎侧的对象:刷新后仍有大量分配存活,页面本身只有 517 个 DOM 节点。
环境
@deepseek-ai/dsh,全局安装)复现步骤
新建一个只含官方 bundle 的 profile,
package.json如下,其余文件从profiles/web复制:{ "name": "dsh-profile-leaktest", "private": true, "dependencies": {}, "dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app"], "patchReload": "live" } } }启动:
dsh --profile leaktest --no-open --port 0。在 Safari 里打开启动时打印的 URL,等加载完成。此时不做任何操作,不打开会话、不预览文件。
每 6 秒刷新一次,共 20 次。
每次刷新后记录该标签页渲染进程的内存:
footprint <WebContent pid>。观测数据
只含官方 bundle 的 profile,20 次刷新,每次间隔 6 秒:
增长是线性的,平均每次约 +47 MB。20 次之后:
另一次测试(profile 里额外带了一个自研插件)结果几乎相同:438 MB → 1313 MB,平均每次 +45 MB,结束后存活分配 313 万个;刷完闲置 40 秒,仍是 1308 MB,没有回收。
已排除
@deepseek-ai/dsh-base+@deepseek-ai/dsh-web-app,泄漏量几乎不变(+47 MB vs +45 MB)。document.getElementsByTagName('*').length为 517,没有 iframe、canvas 或图片,正文 243 个字符。footprint从进程外采集的。影响
用 Tauri 薄壳把
dsh web包成桌面应用时,页面地址变更或后端重启都会触发重新导航,每次累积。实际使用中,一个跑了 7.5 小时的渲染进程占到 1.2 GB,手动刷新几次后涨到 1.5 GB,只能退出应用重开。All reactions