Skip to content
Development
Command

/profile-memory

Capture and analyze memory usage of the application.

From plugin
rohitg00-claude-code-toolkit
2.5k199 skills138 agents199 commands
Install
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/profile-memory

Context preview

What this command does when you run it.

Capture and analyze memory usage of the application.

Command definition

profile-memory.md

/profile-memory - Profile Memory Usage

Capture and analyze memory usage of the application.

Steps

1. Detect the application runtime: Node.js, Python, Java, Go, or browser 2. Configure the profiling tool: Node.js --inspect, Python tracemalloc, Java VisualVM 3. Start the application with memory profiling enabled 4. Capture an initial heap snapshot as the baseline 5. Execute the workload or user scenario to profile 6. Capture a second heap snapshot after the workload completes 7. Compare the two snapshots to identify memory growth 8. Analyze retained objects: which objects are keeping memory alive 9. Identify the top 20 memory consumers by retained size 10. Check for common leak patterns: growing arrays, event listeners, closures, caches 11. Calculate total memory usage: heap used, heap total, RSS, external 12. Generate a memory profile report with growth analysis and object counts

Rules

  • Take multiple snapshots at intervals to detect gradual memory growth
  • Run the profiled scenario multiple times to distinguish leaks from normal allocation
  • Focus on retained size, not shallow size, for identifying actual memory impact
  • Include GC metrics: frequency, pause time, reclaimed memory
  • Profile under realistic load conditions, not idle state
  • Do not profile with debugger attached in production
  • Report memory in human-readable units (KB, MB, GB)
Ships withrohitg00-claude-code-toolkit

The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.

Get the whole plugin