ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

drop-caches-cleanup

一键清理系统内存(RAM)/ One-click system memory cleanup. 当用户说"清理内存"、"释放内存"、"一键清理"、"drop caches"、"内存太高"、"卡"、"慢" / "clear memory"、"free memory"、"memory cleanup"、"system lag" 时使用。 支持 Linux drop_caches / macOS purge,分级清理,阈值检查。

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/aaroncxxx/drop-caches-cleanup
Or

一键清理内存 / 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 一键清理,前后对比显示

Metadata

Author@aaroncxxx
Stars4473
Views0
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-aaroncxxx-drop-caches-cleanup": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

how-much-token-did-this-chat-used

Track and display token usage for the current OpenClaw session and recent sessions, with cost estimation and remaining days projection. Auto-detects active model and matches billing rules dynamically. Shows: current session tokens, session cost, today's cumulative usage, last 10 session averages, 7-day usage trend, top spending sessions, credit balance with alerts, and weighted remaining days projection. Use when the user asks about token consumption, cost, usage stats, "用了多少 token" / "token 用量" / "消耗了多少" / "最近十个chat" / "credit" / "余额" / "还能用几天" / "花费" / "趋势".

aaroncxxx 4473

Mimo Tts Asr 26 Free

Skill by aaroncxxx

aaroncxxx 4473

Empire Architecture

Skill by aaroncxxx

aaroncxxx 4473

mimo-tts-asr

Xiaomi MiMo V2.5 TTS + ASR 全能语音技能。支持高质量中英文语音合成(TTS)和语音识别(ASR)。 TTS: 三款模型(精品音色 / VoiceDesign 音色设计 / VoiceClone 音色克隆)、方言支持、情感控制、多格式输出。 ASR: 音频转文字、多语言识别、方言、Code-Switch、强噪音场景。支持 API 调用和开源模型本地部署。 触发词: 语音合成 / 文字转语音 / TTS / 朗读 / 说话 / 唱歌 / 语音识别 / 转文字 / 听写 / ASR / 音色设计 / 音色克隆 / 声音克隆 / voice design / voice clone / voice / speech / read aloud / transcribe / speech-to-text / 语音转文字 / 音频转文字。 Use when: 用户要求将文字转为语音、朗读文本、生成音频、识别音频内容、将音频转为文字、设计音色、克隆音色。

aaroncxxx 4473

mimotts25

小米大模型 MiMo TTS 2.5 语音合成。支持多种预设音色(中文/英文/默认)、风格控制(情感、方言、角色扮演、语速)、音频标签精细控制。Use when the user asks to convert text to speech, generate audio, read text aloud with a specific style/emotion/dialect, or create voice files.

aaroncxxx 4473