← 返回 Skills 市场
92
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install drop-caches-cleanup
功能描述
一键清理系统内存(RAM)/ One-click system memory cleanup. 当用户说"清理内存"、"释放内存"、"一键清理"、"drop caches"、"内存太高"、"卡"、"慢" / "clear memory"、"free memory"、"memory cleanup"、"system...
使用说明 (SKILL.md)
一键清理内存 / One-Click Memory Cleanup
一键清理 Linux Page Cache 或 macOS 内存缓存,释放物理内存。 One-click cleanup of Linux Page Cache / macOS memory cache to free physical RAM.
关于作者 — 十五年老米粉了!!冲!!!v1.2 优化:分级清理、阈值检查、macOS 支持、内存计算修正。
使用方法 / Usage
bash "{baseDir}/scripts/cleanup.sh" [options]
Options
| Flag | Description |
|---|---|
--level 1|2|3 |
清理级别:1=page cache, 2=dentries+inodes, 3=全部(默认) |
--threshold \x3Cpct> |
内存使用率低于此值时跳过清理 (0-100) |
--dry-run |
仅显示内存状态,不执行清理 |
--json |
JSON 格式输出 |
-h, --help |
显示帮助 |
Examples
# 基础清理(全部缓存)
bash "{baseDir}/scripts/cleanup.sh"
# 只清理 page cache
bash "{baseDir}/scripts/cleanup.sh" --level 1
# 内存使用率低于 70% 时跳过
bash "{baseDir}/scripts/cleanup.sh" --threshold 70
# 先看看状态,不执行
bash "{baseDir}/scripts/cleanup.sh" --dry-run
# JSON 输出(方便程序消费)
bash "{baseDir}/scripts/cleanup.sh" --json
功能 / Features
- ✅ Linux
drop_caches+ macOSpurge双平台支持 - ✅ 分级清理(level 1/2/3)
- ✅ 阈值检查(低于阈值自动跳过)
- ✅ Dry-run 模式(只看不做)
- ✅ 权限预检(不够直接报错)
- ✅ 内存计算修正(用 available 差值,非 used 差值)
- ✅ 清理后自动评估(✅良好 / ⚠️偏高 / 🔴危险)
- ✅ JSON 结构化输出
- ✅ 定时清理建议
清理级别说明
| Level | Linux | macOS |
|---|---|---|
| 1 | Page Cache only | purge(整体清理) |
| 2 | dentries + inodes | purge |
| 3 | 全部(默认) | purge |
macOS 只有
purge一个级别,--level参数在 macOS 上不影响行为。
输出示例
⚡ Drop Caches Cleanup v1.2.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🖥️ 平台: Linux | 清理级别: level 3
📊 清理前:
总量: 3499MB | 已用: 2788MB | 可用: 711MB | 空闲: 150MB
🧹 正在清理 (level 3)...
📊 清理后:
总量: 3499MB | 已用: 1988MB | 可用: 1511MB | 空闲: 950MB
🎉 成功释放 800MB 可用内存!
✅ 内存状态良好 (56%)
💡 如需定时清理,可配置 cron:
0 */6 * * * /path/to/cleanup.sh --threshold 70
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
注意事项 / Notes
- ⚠️ Linux 需要 root/sudo 权限
- ⚠️ macOS 需安装 Xcode CLI tools(
xcode-select --install) - ✅ 只清理缓存(安全操作,不影响数据)
- ⏱️ 清理后可能需要几秒才能看到完整效果
定时清理(Cron)
# 每 6 小时检查一次,使用率超 70% 才清理
0 */6 * * * /path/to/cleanup.sh --threshold 70 --json >> /var/log/mem-cleanup.log
版本历史
v1.2.0 (2026-04-27)
- 🔀 分级清理:
--level 1/2/3,默认 level 3(全部) - 🍎 macOS 支持:自动检测并使用
purge命令 - 🎯 阈值检查:
--threshold低于阈值自动跳过 - 🔍 Dry-run:
--dry-run只看状态不执行 - 🔧 内存计算修正:用
available差值替代used差值 - 🔒 权限预检:执行前检查 root/sudo
- 📊 清理后评估:✅/⚠️/🔴 三级评估
- 📋 JSON 输出:
--json结构化数据 - 💡 cron 建议:清理后提示定时清理配置
v1.1.0 (2026-04-25)
- 🚀 首发:Linux Page Cache 一键清理,前后对比显示
安全使用建议
This skill is coherent with its purpose: it simply runs a shell script that calls sync and writes to /proc/sys/vm/drop_caches on Linux or runs macOS purge. Before using, review the script (you already have the content), and note it requires root/sudo on Linux — only run it when you understand and accept that elevated permission. Test with --dry-run and --threshold to avoid unnecessary runs, and avoid scheduling automatic runs on critical systems unless you understand the operational impact (cache drops can momentarily change performance). If you prefer, copy the script locally and run it manually rather than giving an automated agent sudo access.
功能分析
Type: OpenClaw Skill
Name: drop-caches-cleanup
Version: 1.2.0
The skill is a legitimate system utility designed to clear memory caches on Linux (via /proc/sys/vm/drop_caches) and macOS (via the purge command). The script scripts/cleanup.sh includes safety features such as a dry-run mode, threshold-based execution, and privilege pre-checks, with no evidence of data exfiltration, persistence mechanisms, or malicious prompt injection.
能力评估
Purpose & Capability
Name/description describe one‑click memory/cache cleanup and the included script implements exactly that: Linux drop_caches (writing to /proc/sys/vm/drop_caches) and macOS purge. No unrelated binaries, env vars, or services are requested.
Instruction Scope
SKILL.md instructs running the bundled shell script with clear flags and explains behavior (dry-run, threshold, JSON). The instructions do not ask the agent to read unrelated files, send data externally, or access unrelated credentials.
Install Mechanism
No install spec or remote downloads; the skill is instruction+script only. Nothing is fetched from external URLs or written to system paths by an installer step.
Credentials
The skill requests no environment variables or external credentials. It does require root/sudo at runtime on Linux, which is appropriate and documented for the operation performed.
Persistence & Privilege
always is false and the skill does not modify agent/system-wide settings. It requires elevated privileges only when actually performing drop_caches, which is expected for this operation.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install drop-caches-cleanup - 安装完成后,直接呼叫该 Skill 的名称或使用
/drop-caches-cleanup触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
分级清理 --level 1/2/3; macOS purge 适配; 阈值检查 --threshold; dry-run 模式; 内存计算修正(avail差值); 权限预检; 清理后评估; JSON 输出
v1.1.0
- Added one-click Linux Page Cache cleanup to instantly free physical RAM.
- Displays memory status before and after cleanup, and shows the amount of memory freed.
- Uses the `sync && echo 3 > /proc/sys/vm/drop_caches` command for effective cache drop.
- Requires root/sudo permissions for operation.
- Only clears Page Cache, ensuring safe operation without data loss.
元数据
常见问题
Drop Caches Cleanup 是什么?
一键清理系统内存(RAM)/ One-click system memory cleanup. 当用户说"清理内存"、"释放内存"、"一键清理"、"drop caches"、"内存太高"、"卡"、"慢" / "clear memory"、"free memory"、"memory cleanup"、"system... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 92 次。
如何安装 Drop Caches Cleanup?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install drop-caches-cleanup」即可一键安装,无需额外配置。
Drop Caches Cleanup 是免费的吗?
是的,Drop Caches Cleanup 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Drop Caches Cleanup 支持哪些平台?
Drop Caches Cleanup 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Drop Caches Cleanup?
由 aaroncxxx(@aaroncxxx)开发并维护,当前版本 v1.2.0。
推荐 Skills