본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

openclaw-test-heap-leaks

OpenClaw 테스트의 메모리 증가와 부족 원인을 조사합니다. 측정값과 메모리 객체 기록을 비교해 실제 해제 누락과 테스트 프로세스의 모듈 보존을 구분하고 수정 결과를 검증합니다.

원문원문 설명 보기

Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

AI 평가90점/ 100설치 방법 보기

이럴 때 유용합니다

  • Vitest 메모리 부족 원인을 조사합니다
  • 같은 프로세스의 메모리 기록을 비교합니다
  • 해제 누락과 모듈 보존을 구분합니다
  • 실행 중 메모리 누수 수정을 검증합니다

한국어 소개

할 수 있는 일

OpenClaw 테스트의 메모리 증가와 Vitest의 메모리 부족으로 인한 실패를 조사합니다. 실제 실행 조건을 재현하고 사용량을 측정하며, 메모리 할당 기록과 메모리 내부 객체를 기록한 힙 스냅샷을 비교합니다. 앱의 해제 누락인지 테스트 프로세스에 불러온 모듈이 남아 있는지 구분하고, 원인에 맞는 수정과 재검증으로 이어갑니다.

이럴 때 유용합니다

테스트를 계속할수록 메모리가 늘어나거나 특정 설정 및 병렬 실행 수에서 실패할 때 유용합니다. 오래 실행되는 처리의 수정도 전용 검증 프로그램으로 함수가 보존하던 상태를 해제하는지 확인합니다.

사용 예시

  • “이 테스트의 메모리 부족을 같은 실행 조건으로 재현하고 원인을 조사해 주세요.”
  • “같은 프로세스의 전후 스냅샷을 비교해 주세요.”
  • “수정 후 보존되는 객체가 줄었는지 검증해 주세요.”

주의 사항

OpenClaw의 pnpm 명령, 포함된 스크립트, Vitest 설정을 전제로 하며 관련 openclaw-test-performance 자료도 참조합니다. 기록의 세부 확인에는 DevTools를 사용합니다. 프로세스 전체 사용량이나 객체 이름별 수량 증가만으로 메모리 누수라고 단정하지 않습니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

객관 평가

AI가 SKILL.md의 내용만을 근거로 4가지 관점에서 판정했습니다. 스타 수나 인기도는 판정에 넣지 않았습니다.

지시의 명확성언제 쓰고 무엇을 하는지 알 수 있는가
A양호Vitest 메모리 조사와 실행 중 동작의 수정 검증을 구분하고 각각의 적용 상황과 목적을 설명합니다.
절차의 구체성절차·입출력·예시가 구체적으로 적혀 있는가
A양호재현부터 검증까지 다섯 단계, 비교 명령, 출력 경로, 보고 항목을 명시합니다.
안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호테스트 실행과 수정 범위 및 프로파일과 스냅샷 저장 경로를 명시합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족pnpm, 관련 스크립트, DevTools가 필요하지만 환경 설치 절차는 없습니다.

총점은 각 항목을 A=25점, B=15점, C=5점으로 더한 값입니다. 2026년 10월 19일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(3)

  • SKILL.md7.3 KB
  • agents/openai.yaml237 B
  • scripts/heapsnapshot-delta.mjs13.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

OpenClaw Test Heap Leaks

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.

Read ../openclaw-test-performance/SKILL.md first for the current test-performance commands and proof routing.

For runtime fixes (e.g., closure leaks in long-running services like the gateway), see Validating runtime fixes below — that uses a dedicated harness rather than the unit-test profiling workflow.

Workflow

  1. Reproduce the failing shape first.

    • Match the real entrypoint and worker budget. For a broad unit-fast baseline with per-config max RSS and top-file timing, start with:

      pnpm test:perf:groups \
        --config test/vitest/vitest.unit-fast.config.ts \
        --allow-failures \
        --output .artifacts/test-perf/unit-fast-memory.json
      
    • For a suspected file, rerun that file with one worker and collect wall/RSS evidence: /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose.

    • Current pnpm test execution is planned by scripts/test-projects.mts. Record the printed Vitest config or shard and preserve that shape when the report is configuration- or worker-budget-specific.

  2. Collect the strongest available heap evidence.

    • Run pnpm test:perf:profile:runner -- --output-dir .artifacts/test-perf/vitest-runner-profile -- <file> for a CPU profile plus a sampling heap profile of the unit runner. Open the heap profile in DevTools and inspect the largest allocation families.
    • Sampling .heapprofile output is not a .heapsnapshot; do not pass it to the snapshot delta helper.
    • When a dedicated harness or another known producer emits repeated .heapsnapshot files, compare snapshots from the same PID with .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs.
    • If no snapshot or heap profile is available, RSS growth is useful triage evidence, but keep the leak classification inconclusive.
  3. Classify the growth before choosing a fix.

    • If growth is dominated by Vite/Vitest transformed source strings, Module, system / Context, bytecode, descriptor arrays, or property maps, treat it as likely retained module graph growth in long-lived workers.
    • If growth is dominated by app objects, caches, buffers, server handles, timers, mock state, sqlite state, or similar runtime objects, treat it as a likely cleanup or lifecycle leak.
    • If the names are ambiguous, stop short of a confident label and inspect retainers/dominators in DevTools for the top deltas.
  4. Fix the right layer.

    • For likely retained transformed-module growth in shared workers:
    • Inspect the owning Vitest config and the process chunking in scripts/test-projects.test-support.mjs. Fix process lifetime or project ownership there only when the same-shape evidence shows that shared-worker retention is the cause.
    • test/vitest/vitest.unit-fast-isolated.config.ts is for audited stateful tests that need a fresh module graph. Do not use it as a generic memory-hotspot list.
    • For real leaks:
    • Patch the implicated test or runtime cleanup path.
    • Look for missing afterEach/afterAll, module-reset gaps, retained global state, unreleased DB handles, or listeners/timers that survive the file.
  5. Verify with the most direct proof.

    • Re-run the same grouped or scoped command and confirm the max-RSS trend or OOM is reduced.
    • When a dedicated producer emits heap profiles or snapshots, repeat the same producer and compare equivalent artifacts.
    • For routing or config changes, verify the expected Vitest config or shard starts and the affected tests complete.

Heuristics

  • Do not call everything a leak. Growth in a non-isolated shared Vitest project can be a worker-lifetime problem rather than an application object leak.
  • scripts/test-projects.mts, scripts/test-group-report.mts, and scripts/run-vitest-profile.mts are the current execution, grouped-RSS, and profile entrypoints.
  • The [test] starting ... lines identify the Vitest config or shard to reproduce.
  • .artifacts/vitest-shard-timings.json stores config/shard durations for scheduling. It is not a file-level memory-hotspot or behavior manifest.
  • When the same retained object families grow across multiple intervals in the same worker PID, trust the snapshots over intuition, then confirm ambiguous calls with retainer evidence.

Snapshot Comparison

  • Direct comparison:
    • node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs before.heapsnapshot after.heapsnapshot
  • Auto-select earliest/latest snapshots per PID within one lane:
    • node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs --lane-dir <snapshot-directory>
  • Useful flags:
    • --top 40
    • --min-kb 32
    • --pid 16133

Read the top positive deltas first. Large positive growth in module-transform artifacts points to shared-process lifetime or project ownership; large positive growth in runtime objects suggests a real leak. If the names alone do not settle it, open the same snapshot pair in DevTools and inspect retainers/dominators for the top rows before declaring root cause.

Validating runtime fixes (not test-memory)

The workflow above is for diagnosing Vitest worker memory growth. For validating that a runtime/closure fix actually releases captured state, use the dedicated harness:

  • pnpm leak:embedded-run — runs scripts/embedded-run-abort-leak.ts. Loops N aborted runs in a function-shaped scope mimicking runEmbeddedAttempt, writes heap snapshots, and reports a PASS/FAIL verdict on retention growth using FinalizationRegistry for tracked-instance counting plus RSS delta.

Modes:

  • closure-extracted (default) — production fix shape (helper at module scope).
  • closure-inline — pre-fix shape (closure inside the runner scope). Use as a sensitivity check: if it passes you've broken the harness, not fixed a bug.
  • synthetic-leak — deliberately retains via a module-level bucket. Use to confirm the harness can detect leaks before trusting a PASS on a real fix.

Snapshots land in .tmp/embedded-run-abort-leak/. Diff with the same script as above:

node .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs \
  .tmp/embedded-run-abort-leak/baseline-*.heapsnapshot \
  .tmp/embedded-run-abort-leak/batch-N-*.heapsnapshot --top 30

When fixing a different runtime leak, add a new harness alongside this one rather than retrofitting it. The fixture function should mimic the lexical scope of the function where the leak lives, not be a generic abort-loop.

Output Expectations

When using this skill, report:

  • The exact reproduce command.
  • Which Vitest config or target was reproduced, and which PID was compared when snapshots were available.
  • The dominant retained object families from the heap profile or snapshot delta, when available.
  • Whether the issue is a likely real leak or likely shared-worker retained module growth, plus whether retainers/dominators confirmed it.
  • The concrete fix or impact-reduction patch.
  • What you verified, and what snapshot overhead prevented you from verifying.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

1password

무료

Set up and authenticate the 1Password CLI, then supply stored passwords and API keys to commands or configuration. The skill covers desktop integration, service accounts, and interactive sign-in while keeping secrets out of chat and logs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Setting up the 1Password CLI
  • Supplying API keys to commands
  • Using service account authentication in CI
openclaw/openclaw39.2만2026년 10월 18일 업데이트

acp-router

무료요약 있음AI 평가 80점

OpenClaw에 전달한 자연어 요청을 Claude Code 같은 외부 코딩 에이전트로 연결합니다. ACP나 acpx로 작업을 시작하거나 이어가며 대화 맥락을 유지합니다.

  • 스레드에서 Claude Code 시작
  • 외부 에이전트의 기존 작업 계속
  • acpx로 직접 지시 전달
openclaw/openclaw39.2만2026년 10월 18일 업데이트

Add a model provider to OpenClaw and verify it with a real response. The skill validates configuration, keeps credentials in environment or file references, and reports test results and any default model changes.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Adding a model provider to OpenClaw
  • Configuring credentials through environment or file references
  • Checking whether a model returns a real response
openclaw/openclaw39.2만2026년 10월 18일 업데이트

Prepare an agent activity transcript for a GitHub pull request or issue. Extract relevant prompts, decisions, and results from local logs, remove sensitive material, and preview the edited record before separately authorized publication.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Preparing an agent activity record for a pull request
  • Extracting task-relevant prompts and results from local logs
  • Previewing a transcript with sensitive information removed
openclaw/openclaw39.2만2026년 10월 18일 업데이트

Manage Apple Notes on macOS through memo, a command-line tool. Create, browse, search, edit, delete, and move notes between folders, or export selected notes to HTML or Markdown for use outside the app.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating notes with titles
  • Finding notes by folder or approximate search
  • Editing notes and organizing them into folders
openclaw/openclaw39.2만2026년 10월 18일 업데이트

apple-reminders

무료요약 있음AI 평가 70점

Mac에서 Apple Reminders의 기한이 있는 할 일을 확인하고 추가·편집합니다. 목록 관리와 완료·삭제를 통해 iPhone이나 iPad에서 보는 작업을 정리합니다.

  • 오늘 할 일과 기한이 지난 작업 확인
  • 기한이 있는 개인 할 일 추가
  • iPhone과 iPad에서 보는 작업 정리
openclaw/openclaw39.2만2026년 10월 18일 업데이트

openclaw의 스킬 모두 보기

이 스킬의 문제 신고