rust-memory
Skill0 starsChanged 2 months agoMITView on GitHub
Use to analyze or reduce Rust CLI allocation churn, retained data, growing buffers, or peak-memory use.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- rust-buildSkill
- rust-cli-interfaceSkill
- rust-cli-testingSkill
- rust-concurrencySkill
- rust-debuggingSkill
- rust-designSkill
- rust-distributionSkill
- rust-errorsSkill
- rust-filesystemSkill
- rust-idiomaticSkill
- rust-implementSkill
- rust-ioSkill
- rust-performanceSkill
- rust-processesSkill
- rust-testingSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Remove demonstrated redundant copies and intermediate collections.
- Distinctive: line 18
Use allocation evidence to locate churn and resident-memory evidence for the process budget.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rust Memory
Retention. Account for what stays live, how large it can become, and which owner releases it. Separate allocation count, live heap, peak resident memory, stack, and mapped pages. Honor supplied requirements and preserve settled choices outside the requested change; resolve only what the task leaves open.
Trace the affected owners as input size or concurrency grows; include parser buffers, collections, queues, worker state, output reordering, or captured subprocess data where they contribute. Streaming one stage does not bound a later collector. Name the term that grows before selecting a smaller representation.
Remove demonstrated redundant copies and intermediate collections. Borrow where lifetimes stay simple, move owned data when possible, and reuse buffers in repeated work. A tiny borrowed view or shared reference can retain a large owner; copying a small surviving value may reduce total retention.
Choose capacity from credible bounds or observed distributions. Vec::clear retains capacity; repeated shrinking can replace retention with allocation churn. Account for oversized-record recovery and long-lived buffers. Inline collections enlarge every containing value, and large stack arrays can exhaust worker stacks.
Measure before introducing interning, arenas, custom allocators, alternative hashers, or unsafe storage. Preserve collision resistance where input is adversarial. Memory mapping changes paging and lifetime behavior; file-backed maps require safety conditions against external modification and are not a universal zero-memory read.
Use allocation evidence to locate churn and resident-memory evidence for the process budget. Account for allocator retention, page cache conditions, child processes, and measurement overhead. A falling allocation count alone does not establish lower peak memory.
For an audit or diagnosis, identify supported owners and growth terms, separate hypotheses from observed evidence, and propose the next useful measurement without editing. A code-derived retention bound is not a measured RSS result. For a requested reduction or bound, implement the relevant ownership change, preserve output and failures, and check the bound at its real mechanism. Compare representative inputs when claiming a measured memory improvement; report unavailable measurements without inventing them or treating every task as an allocator investigation.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

