Drop Caches Cleanup

v1.2.0

一键清理系统内存(RAM)/ One-click system memory cleanup. 当用户说"清理内存"、"释放内存"、"一键清理"、"drop caches"、"内存太高"、"卡"、"慢" / "clear memory"、"free memory"、"memory cleanup"、"system...

0· 76·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for aaroncxxx/drop-caches-cleanup.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Drop Caches Cleanup" (aaroncxxx/drop-caches-cleanup) from ClawHub.
Skill page: https://clawhub.ai/aaroncxxx/drop-caches-cleanup
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install drop-caches-cleanup

ClawHub CLI

Package manager switcher

npx clawhub@latest install drop-caches-cleanup
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Scan Findings in Context
[pre-scan-no-findings] expected: Static pre-scan reported no injection signals; consistent with an instruction/script-only utility that contains no network or obfuscated code.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk975pg4cx26e2c8rbfxp2gc4cs85meav
76downloads
0stars
2versions
Updated 1d ago
v1.2.0
MIT-0

一键清理内存 / 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

FlagDescription
--level 1|2|3清理级别:1=page cache, 2=dentries+inodes, 3=全部(默认)
--threshold <pct>内存使用率低于此值时跳过清理 (0-100)
--dry-run仅显示内存状态,不执行清理
--jsonJSON 格式输出
-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 + macOS purge 双平台支持
  • ✅ 分级清理(level 1/2/3)
  • ✅ 阈值检查(低于阈值自动跳过)
  • ✅ Dry-run 模式(只看不做)
  • ✅ 权限预检(不够直接报错)
  • ✅ 内存计算修正(用 available 差值,非 used 差值)
  • ✅ 清理后自动评估(✅良好 / ⚠️偏高 / 🔴危险)
  • ✅ JSON 结构化输出
  • ✅ 定时清理建议

清理级别说明

LevelLinuxmacOS
1Page Cache onlypurge(整体清理)
2dentries + inodespurge
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 一键清理,前后对比显示

Comments

Loading comments...