jetson-memory-audit
FreeRuns bundled scriptsNot checkedMeasure Jetson DRAM/NvMap usage and verify before/after memory reclamation with live audit data.
by NVIDIA★ 4,269 GitHub starsAbout this skill
Jetson Memory Audit
Read-only memory-focused snapshot for a Jetson, plus the drop_caches verify-loop helper that confirms freed memory actually shows up as free instead of cached.
Purpose
Measure current Jetson memory consumers, capture before/after baselines, and verify whether user-approved changes actually reclaimed DRAM. Use live device data rather than estimates from container size, model size, or generic process memory.
CRITICAL: Memory appears stuck after stopping vLLM / sglang (JetPack below 7.2 / L4T below r39.0)
This is the most common memory confusion on Jetson releases before JetPack 7.2 or before L4T r39.0.
After you stop a vLLM, sglang, or Ollama server (or any CUDA workload), the memory shown as free by free -h or tegrastats may not recover — even though the process is gone. nvidia-smi may also show misleadingly low free GPU memory.
Root cause: The Thor RM (resource manager) holds freed sysmem pages in its own pool after a CUDA context exits. On Unified Memory Architecture (UMA) devices like Jetson, cudaMemGetInfo reads RM pool state and reports far less free memory than is actually available to a new process.
Workaround (for JetPack below 7.2 or L4T below r39.0):
sudo sync && sudo sysctl -w vm.drop_caches=3
Run this on the host, not inside a container. The important operation is sudo sysctl -w vm.drop_caches=3; keep sudo sync immediately before it so dirty data is flushed before reclaimable page/dentry/inode caches are dropped. After running it, free -h and tegrastats will reflect the true available memory.
For affected releases, recommend this command when a user says:
- "Memory didn't free after I stopped vLLM/sglang"
- "Why does tegrastats still show high usage after my container exited?"
- "OOM even though nothing is running"
- "Memory was fine yesterday but now it's full"
On JetPack below 7.2 or L4T below r39.0, drop_caches is the reliable workaround when memory appears stuck after a CUDA workload exits; on newer releases, use it only if the same symptom is observed and the user approves.
When to use
- "How much memory is in use on this Jetson? What's holding it?"
- "I disabled the GUI / stopped vLLM / quit my container — did memory actually free?"
- "Why does
free -hstill show low free memory after I stopped my workload?" - As the baseline before applying
jetson-headless-modeor other memory-related changes, and again after to compute the actual delta.
Prerequisites
- Run on the Jetson host, or in a sandbox/container with host-visible
/proc,/etc/nv_tegra_release,tegrastats, and process data. - NvMap debugfs reads may require root. If unavailable, report that GPU memory attribution is limited rather than guessing.
drop_caches.shrequires root or passwordlesssudo -n; run it only after the user explicitly authorizes cache dropping.
Available Scripts
| Script | Purpose | Arguments |
|---|---|---|
scripts/audit.sh |
Emits a JSON snapshot from jetson-diagnostic/scripts/snapshot.sh for memory audit workflows. |
No arguments. |
scripts/drop_caches.sh |
Flushes reclaimable page/dentry/inode caches and prints before/after memory deltas. | --mode 1|2|3, --quiet. |
If your agent runtime supports run_script, use it to run scripts/audit.sh or scripts/drop_caches.sh and summarize the returned output. Otherwise run the scripts with bash from the repository root.
Instructions
For "how much memory is in use right now?" questions, run scripts/audit.sh and report only values from the JSON snapshot.
Reporting guidance
Do not only print or mention the path to a helper. Invoke the helper and then summarize the returned data.
- For "how much memory is in use" prompts, run
scripts/audit.shand quotemem_total_gb,memory_kb.available, and the leadingprocrank_topprocess ornvmap.top_clientsconsumer. - For GUI/desktop memory prompts, run
scripts/audit.shand reportdefault_systemd_targetplus any display manager incandidate_services(gdm3,gdm,lightdm,sddm, ordisplay-manager). Do not disable anything; hand off tojetson-headless-modefor a plan. - For prompts that explicitly authorize cache dropping after a stopped workload, run
scripts/drop_caches.sh(equivalent tosudo sync && sudo sysctl -w vm.drop_caches=3by default) and report its before/after free, available, and cached deltas. If root is unavailable, explain that it must be run on the host with sudo.
If your agent runtime does not execute helper scripts relative to this skill directory, resolve script paths with the AgentSkills {baseDir} placeholder:
{baseDir}/scripts/audit.sh
{baseDir}/scripts/drop_caches.sh
Do not call jetson-memory-audit as a tool name unless the runtime explicitly registers skills as callable tools; Agent Skills are normally instructions plus files, not direct tool functions.
Sandbox note for agents: seeing this s
Install jetson-memory-audit in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the jetson-memory-audit skill do?
Measure Jetson DRAM/NvMap usage and verify before/after memory reclamation with live audit data.
How do I install the jetson-memory-audit skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the jetson-memory-audit skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic