帮助定位 OpenClaw 测试中的内存增长、堆泄漏与 OOM 根因
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "openclaw-test-heap-leaks" 技能: 1. 下载 https://raw.githubusercontent.com/openclaw/openclaw/main/.agents/skills/openclaw-test-heap-leaks/SKILL.md 2. 保存为 ~/.claude/skills/openclaw-test-heap-leaks/SKILL.md 3. 装好后重载技能,告诉我可以用了
请帮我分析 OpenClaw 在 pnpm test 期间的内存增长问题。结合 RSS 曲线、heap snapshot 对比和可能的测试隔离问题,给出最可能的泄漏来源、验证步骤以及修复建议。
一份定位报告,包含可疑泄漏点、证据链、复现与验证方法,以及具体修复方向。
我有两份测试前后的 Node.js heap snapshot,请帮我比较 retained size 增长明显的对象类型,判断哪些可能是未释放的模块缓存、事件监听器或全局状态。
一份堆快照差异解读,指出增长异常的对象类别及其潜在代码来源。
基于 OpenClaw 当前测试执行方式,帮我提出降低 RSS 峰值和避免 Vitest OOM 的优化方案,覆盖并发数、测试拆分、资源清理和调试开关设置。
一套可执行的测试优化清单,按优先级列出预期收益、实施方式和风险。
Use this skill for test-memory investigations. Do not guess from RSS alone when heap snapshots are available. Treat snapshot-name deltas as triage evidence, not proof, until retainers or dominators support the call.
For runtime fixes (e.g., closure leaks in long-running services like the gateway), see Validating runtime fixes below — that uses a dedicated harness, not the test-parallel snapshot machinery.
Reproduce the failing shape first.
pnpm canvas:a2ui:bundle && OPENCLAW_TEST_MEMORY_TRACE=1 OPENCLAW_TEST_HEAPSNAPSHOT_INTERVAL_MS=60000 OPENCLAW_TEST_HEAPSNAPSHOT_DIR=.tmp/heapsnap OPENCLAW_TEST_WORKERS=2 OPENCLAW_TEST_MAX_OLD_SPACE_SIZE_MB=6144 pnpm testOPENCLAW_TEST_MEMORY_TRACE=1 enabled so the wrapper prints per-file RSS summaries alongside the snapshots.[test-parallel] start ... lines or pnpm test --plan. Do not assume a single unit-fast lane; local plans often split into unit-fast-batch-*.Wait for repeated snapshots before concluding anything.
.tmp/heapsnap/unit-fast-batch-2/..agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs to compare either two files directly or the earliest/latest pair per PID in one lane directory.Classify the growth before choosing a fix.
Module, system / Context, bytecode, descriptor arrays, or property maps, treat it as likely retained module graph growth in long-lived workers.Fix the right layer.
test/fixtures/test-timings.unit.json and whether scripts/test-update-memory-hotspots.mjs should refresh the measured hotspot manifest before hand-editing behavior overrides.test/fixtures/test-parallel.behavior.json only when timing-driven peeling is insufficient.singletonIsolated for files that are safe alone but inflate shared worker heaps.test/fixtures/test-timings.unit.json, call that out explicitly. Missing timings are a scheduling blind spot.afterEach/afterAll, module-reset gaps, retained global state, unreleased DB handles, or listeners/timers that survive the file.Verify with the most direct proof.
…
帮助排查 OpenClaw 节点在配对、鉴权、路由与连接中的故障问题。
帮助团队核验 OpenClaw 版本是否已在多渠道完整发布并可正常使用。
帮助团队检索重复的 PR 与问题单,并自动分组同步重复状态。
帮助你在 Discord 中收发消息、管理频道互动并自动化协作流程
按模型汇总 CodexBar 本地费用日志,快速查看 Codex 或 Claude 的成本明细。
帮助用户搜索梗图模板、推荐合适格式并生成可分享的表情包图片。
用于分析并优化 OpenClaw 测试与插件套件的性能瓶颈、内存占用和覆盖率耗时。
基于问题或 PR 列表深度审查代码,只修复高确定性的小型 OpenClaw 缺陷。
帮助你在核对来源的前提下重构 OpenClaw 文档页面并完成验证
帮助开发者批量定位并修复可合入的高置信小型 OpenClaw 缺陷
基于 Git 历史重生成 OpenClaw 发布更新日志,便于发版前整理版本说明。
帮助开发者选择并执行 OpenClaw 测试、CI 校验与发布验证的最优路径。