skills/memory-optimization/SKILL.md
Profile and optimize application memory usage. Identify memory leaks, reduce memory footprint, and improve efficiency for better performance and reliability.
npx skillsauth add aj-geddes/useful-ai-prompts memory-optimizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Memory optimization improves application performance, stability, and reduces infrastructure costs. Efficient memory usage is critical for scalability.
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
// Node.js profiling
node --inspect app.js
// Open chrome://inspect
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Memory Profiling | Memory Profiling | | Memory Leak Detection | Memory Leak Detection | | Optimization Techniques | Optimization Techniques | | Monitoring & Targets | Monitoring & Targets |
development
Implement Zero Trust security model with identity verification, microsegmentation, least privilege access, and continuous monitoring. Use when building secure cloud-native applications.
development
Prevent Cross-Site Scripting (XSS) attacks through input sanitization, output encoding, and Content Security Policy. Use when handling user-generated content in web applications.
tools
Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.
development
Implement real-time bidirectional communication with WebSockets including connection management, message routing, and scaling. Use when building real-time features, chat systems, live notifications, or collaborative applications.