Agent skill · Workflow & Productivity

matlab-optimize-memory

Guides the 7-step MATLAB memory optimization workflow: baseline, profile, identify, optimize, measure, verify, report. Use when asked to reduce MATLAB memory usage, find memory bottlenecks, fix out-of-memory errors, or optimize memory-intensive code.

matlabgithub.com/matlabGitHub ↗
claude-codecodexcopilotNOASSERTION
Install
npx skills add matlab/matlab-agentic-toolkit --skill matlab-optimize-memory --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 5 KB
Bundled scripts: none
Version: 1.1
Declared author: MathWorks
Path: skills-catalog/matlab-software-development/matlab-optimize-memory/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 868
Language: MATLAB

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# MATLAB Memory Optimization Workflow Systematic 7-step workflow for finding and fixing memory bottlenecks in MATLAB code. ## When to Use - User gets out-of-memory errors running MATLAB code - User wants to reduce memory usage of their MATLAB program - User wants to process larger datasets without running out of memory - User asks to profile or measure memory allocations ## When NOT to Use - The bottleneck is execution speed, not memory (use `matlab-optimize-performance`) - The memory issue is in compiled C/MEX code that can't be changed at the M-code level - Memory usage is dominated by I/O buffers (memory-mapped files, database connections) ## The 7-Step Workflow ### Step 1: Establish Memory Baseline Measure current memory usage before making changes. ```matlab m0 = memory; targetFunction(inputs); m1 = memory; deltaBytes = m1.MemUsedMATLAB - m0.MemUsedMATLAB; fprintf('Memory delta: %.2f MB\n', deltaBytes / 1e6); ``` When `memory` errors (Linux/macOS), use `whos` for variable sizes or Java runtime for heap: ```matlab info = whos('result'); fprintf('Variable size: %.2f MB\n', info.bytes / 1e6); ``` ### Step 2: Profile Memory Allocations Find where memory is being allocated. ```matl

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. The 7-Step Workflow
  4. Step 1: Establish Memory Baseline
  5. Step 2: Profile Memory Allocations
  6. Step 3: Identify Optimization Opportunities
  7. Step 4: Implement Optimizations
  8. Step 5: Measure Optimized Memory
  9. Step 6: Verify Correctness
  10. Step 7: Report Results
  11. Key Rules
  12. Platform Notes
Ships with 2 files
  • manifest.yaml
  • references/memory-patterns.md
More from matlab-agentic-toolkit
All skills →
About this skill
What does the matlab-optimize-memory skill do?

Guides the 7-step MATLAB memory optimization workflow: baseline, profile, identify, optimize, measure, verify, report. Use when asked to reduce MATLAB memory usage, find memory bottlenecks, fix out-of-memory errors, or optimize memory-intensive code.

How do I install it?

Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-optimize-memory --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going