원클릭으로
memory-capture
Memory profile snapshot capture and baseline comparison. Use for verification after memory optimization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Memory profile snapshot capture and baseline comparison. Use for verification after memory optimization.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Create a git worktree for a new TASK. Use when starting a new feature, fix, or refactor task that requires isolated development.
Go code quality rules and standards for kattle project. Apply when writing or reviewing Go code.
macOS native memory analysis tools (leaks, heap, vmmap, Instruments). Use for native app memory debugging.
Go application memory profiling and analysis. Use when investigating memory leaks or high memory usage.
React/TypeScript code quality rules for kattle frontend. Apply when writing or reviewing frontend code.
Run Go and frontend tests for kattle project. Use after code changes to verify correctness.
| name | memory-capture |
| description | Memory profile snapshot capture and baseline comparison. Use for verification after memory optimization. |
| disable-model-invocation | false |
| user-invocable | true |
| allowed-tools | Bash, Read |
This skill provides tools for capturing memory profile snapshots and comparing them against baseline profiles to verify memory optimization efforts.
IMPORTANT: pprof server requires KATTLE_DEBUG=1 environment variable:
# Start the application with debug mode enabled
KATTLE_DEBUG=1 wails dev
Verify pprof server is running:
curl -s http://localhost:6060/debug/pprof/ > /dev/null && echo "pprof OK" || echo "pprof NOT available"
Note: Run all commands from project root directory where baseline_heap.pb.gz and baseline_goroutine.txt are located.
Captures the current heap memory profile:
curl -s -o /tmp/current_heap.pb.gz http://localhost:6060/debug/pprof/heap
This generates a compressed protobuf format heap profile that can be analyzed with go tool pprof.
Captures the current goroutine information:
curl -s http://localhost:6060/debug/pprof/goroutine?debug=1 > /tmp/current_goroutine.txt
This captures goroutine stack traces in text format for easy inspection.
Compare current heap profile against baseline using pprof's diff mode:
go tool pprof -diff_base=baseline_heap.pb.gz -top /tmp/current_heap.pb.gz
This shows the differences in memory allocation between the baseline and current profiles.
Extract and compare actual goroutine counts (not line counts):
# Extract goroutine count from first line "goroutine N [...]"
head -1 baseline_goroutine.txt | grep -oE 'goroutine [0-9]+' | cut -d' ' -f2
head -1 /tmp/current_goroutine.txt | grep -oE 'goroutine [0-9]+' | cut -d' ' -f2
Or count total goroutines in the profile:
grep -c '^goroutine' baseline_goroutine.txt
grep -c '^goroutine' /tmp/current_goroutine.txt
When optimization is verified and improvements are confirmed:
cp /tmp/current_heap.pb.gz baseline_heap.pb.gz
cp /tmp/current_goroutine.txt baseline_goroutine.txt
This updates the baseline profiles for future comparisons.
Use the provided capture-profile.sh script to capture both profiles in one command:
./scripts/capture-profile.sh [PORT]
Default port is 6060 if not specified.