CLI tool for RAM management on macOS (Apple Silicon)
ramctl is a lightweight command-line interface for monitoring and managing RAM on macOS systems with Apple Silicon. It provides real-time memory statistics, process monitoring, and memory cleanup utilities.
- Memory Status: Display current RAM usage, swap, and memory pressure
- Process Monitoring: List top processes by memory consumption
- Real-time Monitor: Continuous monitoring with customizable refresh intervals
- Memory Cleanup: Purge disk cache to reclaim memory (requires sudo)
- Process Management: Terminate processes by PID to free memory
- Color-coded Output: Visual indicators for memory pressure levels
# Clone the repository
git clone https://github.com/Samsuesca/ram_manager_cli.git
cd ram_manager_cli
# Build release binary
cargo build --release
# Install to PATH (optional)
cargo install --path .- macOS with Apple Silicon (M1/M2/M3)
- Rust 1.70 or higher
ramctl statusDisplays:
- Total, used, available, and free memory
- Swap usage
- Memory pressure (normal/warning/critical)
# Show top 15 processes (default)
ramctl top
# Show custom number of processes
ramctl top --count 20# Monitor every 2 seconds (default)
ramctl monitor
# Custom interval and process count
ramctl monitor --interval 5 --count 15Press Ctrl+C to stop monitoring.
# Purge disk cache (requires sudo)
sudo ramctl clean# Terminate process by PID
ramctl kill <PID>| Command | Description | Options |
|---|---|---|
status |
Show current memory status | None |
top |
List top processes by RAM usage | -c, --count <N> |
monitor |
Real-time memory monitoring | -i, --interval <seconds> -c, --count <N> |
clean |
Purge disk cache (sudo required) | None |
kill |
Terminate process by PID | <PID> |
┌─────────────────────────────────────────────────────────┐
│ MEMORY STATUS │
├─────────────────────────────────────────────────────────┤
│ Total: 16.00 GB │
│ Used: 12.34 GB (77.1%) │
│ Available: 3.66 GB │
│ Free: 1.45 GB │
│ Swap Used: 512.00 MB │
│ Pressure: ⚠️ Warning │
└─────────────────────────────────────────────────────────┘
┌─────┬─────────────────────┬─────────┬──────────┐
│ PID │ Name │ Memory │ CPU (%) │
├─────┼─────────────────────┼─────────┼──────────┤
│ 234 │ Google Chrome │ 2.1 GB │ 45.2 │
│ 567 │ Visual Studio Code │ 1.8 GB │ 12.3 │
│ 890 │ Docker Desktop │ 1.2 GB │ 8.5 │
└─────┴─────────────────────┴─────────┴──────────┘
- Language: Rust 2021 edition
- Dependencies:
clap- Command-line argument parsingsysinfo- System metrics collectioncolored- Terminal color outputtabled- ASCII table formattingbytesize- Human-readable byte sizesctrlc- Signal handling
src/
├── main.rs # CLI entry point and command routing
├── memory.rs # Memory snapshot and pressure monitoring
├── process.rs # Process enumeration and filtering
├── cleaner.rs # Memory purge and process termination
└── display.rs # Formatted output rendering
| Platform | Support |
|---|---|
| macOS (Apple Silicon) | ✅ Full support |
| macOS (Intel) | |
| Linux | ❌ Not supported |
| Windows | ❌ Not supported |
MIT License - see LICENSE file for details
Angel Samuel Suesca Ríos suescapsam@gmail.com
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Support for Intel-based Macs
- Linux compatibility
- Memory leak detection
- Historical memory usage graphs
- Configuration file support
- Notification system for high memory usage
Built with Rust for the macOS ecosystem.