ios-memgraph-leaks

Capture and inspect iOS simulator memgraphs to diagnose memory leaks and retain cycles.

25|1|Updated Feb 10, 2026
One-click install
npx skills add https://github.com/wisdom-in-a-nutshell/agents --skill ios-memgraph-leaks-wisdom-in-a-nutshell
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ios-memgraph-leaks
Source: https://github.com/wisdom-in-a-nutshell/agents/tree/main/plugins-source/external/build-ios-apps/skills/ios-memgraph-leaks
Command: npx skills add https://github.com/wisdom-in-a-nutshell/agents --skill ios-memgraph-leaks-wisdom-in-a-nutshell

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Debugging iOS memory leaks requires capturing memory graphs from running simulator processes and interpreting Apple's leaks output, which is tedious and error-prone when done manually. This Skill automates memgraph capture, leak summarization, and ownership-path analysis so you can prove and fix retain cycles with concrete before/after evidence. ## Core Features & Use Cases - Memgraph Capture: Capture a .memgraph from a running iOS simulator app by UDID and bundle identifier using the capture_sim_memgraph.sh script. - Leak Summarization: Parse leaks output into a Markdown report with top leaked types, images, traceTree excerpts, and grouped leak trees via summarize_memgraph_leaks.py. - Root-Cause Workflow: Follow structured rules for identifying app-owned leaked types, proving retain cycles with ownership paths, and verifying fixes with before/after captures. - Use Case: You notice memory growth after repeatedly opening and closing a screen. Use this Skill to capture a memgraph, identify the self-retaining view controller, apply the smallest retaining-edge fix, and recapture to prove the leak disappeared. ## Quick Start Ask the agent to capture a memgraph from your running simulator app and summarize its leaks to find the retain cycle.

Frequently Asked Questions about ios-memgraph-leaks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I capture a memgraph from a running iOS simulator app?▼

Run capture_sim_memgraph.sh with the simulator UDID and app bundle identifier. The script resolves the running PID via xcrun simctl launchctl list and invokes the leaks tool with --outputGraph to write a .memgraph file plus metadata.

How do I find retain cycles in an iOS app?▼

Capture a memgraph, then summarize it with summarize_memgraph_leaks.py to list leaked types and traceTree ownership paths. For unreachable self-retained cycles where traceTree finds no roots, use leaks --groupByType to identify the retained fields and payload chain.

Can I analyze an existing .memgraph file without a running simulator?▼

Yes, summarize_memgraph_leaks.py accepts any existing .memgraph file path and runs leaks --list, --traceTree, and --groupByType against it. A live simulator is only needed for the initial capture step.

Why does leaks traceTree report zero roots referencing my leaked object?▼

A zero-roots result indicates an unreachable or self-retained leak, common with retain cycles. Use the grouped leak tree from leaks --groupByType plus source verification to find the self-retaining edge instead of relying on traceTree.

What if the capture script cannot find my app's process?▼

Confirm the bundle identifier is correct and that the app is actually running on the specified simulator UDID. Use xcrun simctl spawn <udid> launchctl list to inspect running labels and match the exact process name.