rdk-memory-audit

Measure DRAM and CMA/ION memory on RDK devices and verify reclamation with before/after data.

3|Updated Aug 6, 2026
One-click install
npx skills add https://github.com/D-Robotics/rdk-skills --skill rdk-memory-audit-d-robotics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rdk-memory-audit
Source: https://github.com/D-Robotics/rdk-skills/tree/main/skills/rdk-memory-audit
Command: npx skills add https://github.com/D-Robotics/rdk-skills --skill rdk-memory-audit-d-robotics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Developers on D-Robotics RDK boards often cannot tell how much memory is actually available or whether cache clearing really freed anything, leading to guesswork when models fail to load or systems run low on RAM. This Skill replaces estimation with measured before/after data from live audit scripts. ## Core Features & Use Cases - JSON Memory Audit: Run scripts/audit.sh to capture DRAM, CMA, swap, and top RSS processes as structured JSON with a labeled baseline. - Verified Reclamation Loop: scripts/reclaim_verify.sh performs a baseline → drop_caches → re-measure cycle, defaulting to dry-run and only executing with explicit --apply and root. - Grounded Diagnosis: A reference document explains RDK memory layout (ION pool, CMA, page cache) so conclusions about issues like "ion alloc failed" come from official documentation, not assumptions. - Use Case: Before deploying a model, a developer asks how much memory is left; the Skill measures available DRAM and CMA, previews a cache drop, and after user confirmation reports exactly how many KB were reclaimed. ## Quick Start Ask the agent to measure how much memory is left on your RDK board and verify how much can be freed by clearing caches.

Frequently Asked Questions about rdk-memory-audit

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

FAQPage Schema
How do I check available memory on a D-Robotics RDK board?▼

Run scripts/audit.sh with a label such as --label baseline on the RDK host. It outputs JSON with MemAvailable, Cached, Buffers, CmaTotal/CmaFree, swap, and the top five RSS processes, giving a measured snapshot instead of an estimate.

How do I free memory with drop_caches on Linux and verify it worked?▼

Run scripts/reclaim_verify.sh first as a dry-run to preview the planned actions, then re-run with --apply as root after confirmation. The script reports before_available_kb, after_available_kb, and reclaimed_kb so the result is measured, not assumed.

Does drop_caches free CMA or ION memory on RDK devices?▼

No. drop_caches only reclaims page cache, dentries, and inodes; it cannot release CMA/ION memory held by drivers or loaded models. For ion alloc failed errors, reduce model size or stop processes holding ION memory instead.

Why does reclaim_verify.sh fail with a permission error?▼

Writing to /proc/sys/vm/drop_caches requires root. Re-run with sudo bash scripts/reclaim_verify.sh --apply; the script exits with a clear permission-denied message rather than silently degrading or fabricating after data.

What are the limitations of memory auditing on RDK boards?▼

CMA fields depend on the kernel exposing CmaTotal/CmaFree and are reported as null when missing. The audit also cannot stop services or the desktop; freeing resident memory requires handing off to a headless-mode workflow, and swap tuning is a generic Linux measure.