Skip to content
aj-geddes avatar

Memory Optimization

Guide for profiling and fixing application memory use, leaks, and out-of-memory crashes.

CCM score
35 of 100
skills.sh installs
555
GitHub stars
396
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers memory profiling, leak detection, optimization techniques, and monitoring targets through four reference guides
  • Includes browser heap inspection, React DevTools Profiler, Chrome DevTools heap snapshots, and Node.js --inspect profiling
  • Provides a quick-start walkthrough for comparing heap snapshots to find retained objects and retained sizes
  • Designed for diagnosing high memory usage, suspected leaks, slow performance, and scaling problems

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill memory-optimization -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Memory Optimization

Table of Contents

Overview

Memory optimization improves application performance, stability, and reduces infrastructure costs. Efficient memory usage is critical for scalability.

When to Use

  • High memory usage
  • Memory leaks suspected
  • Slow performance
  • Out of memory crashes
  • Scaling challenges

Quick Start

Minimal working example:

// Browser memory profiling

// Check memory usage
performance.memory: {
  jsHeapSizeLimit: 2190000000,    // Max available
  totalJSHeapSize: 1300000000,    // Total allocated
  usedJSHeapSize: 950000000       // Currently used
}

// React DevTools Profiler
- Open React DevTools → Profiler
- Record interaction
- See component renders and time
- Identify unnecessary renders

// Chrome DevTools
1. Open DevTools → Memory
2. Take heap snapshot
3. Compare before/after
4. Look for retained objects
5. Check retained sizes

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Debugging, Frontend & UI Code
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258

Similar to Memory Optimization

More Debugging