memory-audit

Audit embedded code for stack overflows, heap fragmentation, and memory leaks.

7.5k|1.8k|Updated Nov 10, 2013
One-click install
npx skills add https://github.com/FastLED/FastLED --skill memory-audit-fastled
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: memory-audit
Source: https://github.com/FastLED/FastLED/tree/main/.claude/skills/memory-audit
Command: npx skills add https://github.com/FastLED/FastLED --skill memory-audit-fastled

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Memory safety is critical on resource-constrained embedded systems. Without careful analysis, stack overflows, heap fragmentation, and static allocation mismatches can cause crashes or OOM. This skill provides a structured audit workflow to identify risks and offer concrete mitigations.

Core Features & Use Cases

  • Memory usage breakdown by stack, heap, and static data with platform-specific considerations.
  • Platform-aware recommendations (ESP32, Cortex-M, AVR) for memory layout, PSRAM usage, and allocation patterns.
  • Actionable remediation guidance that can be integrated into CI checks or manual reviews.

Quick Start

Audit a memory-heavy module by applying memory-audit to identify stack usage, heap behavior, and static allocation risks and propose fixes.

Frequently Asked Questions about memory-audit

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

FAQPage Schema
How do I audit embedded code for memory safety risks like stack overflows and heap fragmentation?

To audit embedded memory safety, analyze stack usage, heap allocations, and static data patterns to identify stack overflows, heap fragmentation, and memory leaks, then apply actionable mitigations. This structured workflow reviews constrained device codebases for critical memory risks.

What causes heap fragmentation and stack overflows on ESP32 and Cortex-M microcontrollers?

Heap fragmentation and stack overflows on ESP32 and Cortex-M devices stem from unconstrained dynamic allocations and unchecked recursive function calls. Analyzing platform-specific memory layouts and static allocation patterns exposes these out-of-memory risks.

How do I integrate a memory usage audit into my CI checks for AVR or ESP32 releases?

Integrate memory audits into CI checks by applying the review workflow to validate memory usage across stack, heap, and static data before releases. This generates actionable remediation guidance to prevent OOM crashes on AVR and ESP32 platforms.

Does this memory audit workflow support analyzing PSRAM usage on ESP32 platforms?

Yes, the memory audit supports ESP32 platforms by providing platform-aware recommendations for PSRAM usage, memory layout, and allocation patterns. It evaluates platform-specific memory constraints to prevent static allocation mismatches and crashes.

What is the best way to review static allocation patterns in embedded systems to prevent OOM errors?

The best way to review static allocation patterns is performing a structured memory breakdown of stack, heap, and static data. This identifies static allocation mismatches and memory leaks on constrained devices, yielding concrete mitigations for OOM risks.