🦀 ClawHub
Drop Caches Cleanup
by @aaroncxxx
一键清理系统内存(RAM)/ One-click system memory cleanup. 当用户说"清理内存"、"释放内存"、"一键清理"、"drop caches"、"内存太高"、"卡"、"慢" / "clear memory"、"free memory"、"memory cleanup"、"system...
💡 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-runJSON 输出(方便程序消费)
bash "{baseDir}/scripts/cleanup.sh" --json
⚙️ Configuration
| Flag | Description |
|------|-------------|
| --level 1\|2\|3 | 清理级别:1=page cache, 2=dentries+inodes, 3=全部(默认) |
| --threshold | 内存使用率低于此值时跳过清理 (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-runJSON 输出(方便程序消费)
bash "{baseDir}/scripts/cleanup.sh" --json
TERMINAL
clawhub install drop-caches-cleanup