ormus-solutions/libreembed-claude-code/memory-mgmt-patterns
- community
Checking that the SKILL.md file is still in the repository.
Deterministic memory patterns: static FreeRTOS objects, pools for variable-rate messages, heap statistics, stack high-water mark audits, and placing arrays in specific SRAM regions. Use when removing malloc from firmware or tracking down memory exhaustion.
Install
npx vskill@latest install ormus-solutions/libreembed-claude-code/memory-mgmt-patternsSKILL.md
memory-mgmt-patterns
Knowledge Base
Embedded memory management patterns for deterministic, fragmentation-free firmware.
Pattern 1: Static FreeRTOS Objects
Avoid dynamic allocation for RTOS objects. All objects pre-allocated at compile time.
Required in FreeRTOSConfig.h: configSUPPORT_STATIC_ALLOCATION 1.
Pattern 2: Memory Pool for Variable-Frequency Messages
When messages arrive at variable rate, a pool prevents heap fragmentation:
Pattern 3: Heap Statistics Monitoring
xMinimumEverFreeBytesRemaining is the all-time low-water mark — use it for sizing.
Pattern 4: Stack High-Water Mark Audit
Pattern 5: Placing Arrays in Specific SRAM Regions
Requires corresponding sections in linker script targeting the CCM/SRAM2 MEMORY regions.
Anti-Patterns
- Calling `malloc` in ISR:
mallocis not reentrant and not interrupt-safe. Use a pool. - Not checking `pvPortMalloc` return value: returns NULL on heap exhaustion. Dereferencing NULL = HardFault.
- Single heap_4 spanning all SRAM: if DMA buffers and task stacks share one heap, a DMA overrun can corrupt task stacks silently.
- Stack too small with `printf`:
printfwith float formatting (%f) uses ~1KB of stack. Use integer formatting in embedded code.
References
- FreeRTOS Heap: freertos.org/a00111.html
- ARM MPU: ARM Cortex-M4 Generic User Guide, Chapter 4.5
- FreeRTOS
uxTaskGetStackHighWaterMark: freertos.org/uxTaskGetStackHighWaterMark.html
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/memory-management/skills/memory-mgmt-patterns/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ormus-solutions/libreembed-claude-code/memory-mgmt-patterns)