Proc Killer is a cross-platform system-level process monitoring tool which continuously monitors CPU and memory usage of system processes, intelligently flags processes exceeding configurable thresholds, and optionally terminates them - all while ensuring system-critical processes remain untouched.
Currently set for Ubuntu/Linux-based systems. Change the protected process names to work on Windows/macOS.
proc_killer/
├── cmd/
│ └── procwatch/
│ └── main.go # CLI entrypoint
├── internal/
│ ├── monitor/
│ │ ├── scanner.go # Collects process metrics
│ │ └── watcher.go # Polling & monitoring loop
│ ├── system/
│ │ └── signals.go # SIGTERM / SIGKILL helpers
│ ├── engine/
│ │ ├── decision.go # Connects Go with Python rules
│ │ └── python.go # Executes kill actions safely
│ └── config/
│ └── config.go # Thresholds, intervals, dry-run
├── python/
│ └── rules/
│ ├── rules.py # Rule-based decision logic
│ └── models.py # Optional heuristics
├── scripts/
│ └── install.sh # Environment setup
├── go.mod # Go module
└── README.md
- Linux-based system (works on Windows/macOS too but protected process names must be adapted)
- Go >= 1.21
- Python >= 3.10
Clone the repository:
git clone https://github.com/CodenWizFreak/proc_killer.git
cd proc_killerRun the installation script:
chmod +x scripts/install.sh
./scripts/install.shActivate Python virtual environment:
source venv/bin/activateInstall Go dependencies:
go get github.com/shirou/gopsutil/v3/processRun the CLI:
go run cmd/procwatch/main.goExample output (visualized):
Starting Process Watcher & Auto-Killer...
[SAFE] Skipping protected process systemd (1)
[DRY-RUN] Would kill chrome (5678)
[WARN] firefox (1234) CPU: 55.0 MEM: 600.0 MBModify thresholds and intervals in internal/config/config.go:
CPUThreshold float64 // CPU % to trigger action
MemoryThreshold float64 // Memory in MB to trigger action
PollInterval time.Duration // e.g., 5 * time.Second
DryRun bool // safe testing modeAdd or modify protected processes:
ProtectedProcesses = []string{
"init", "systemd", "bash", "sshd", "python3", "go",
}python/rules/rules.pyreceives process data in JSON and returns "KILL", "WARN", or "OK".- models.py can hold advanced heuristics or ML models for smarter decision-making.
Sample input/output:
Input: {"PID":1234,"Name":"firefox","CPU":90,"Memory":600}
Output: {"decision":"KILL"}- Protected process list prevents killing critical system processes.
- Dry-run mode allows safe testing.
- Optionally, skip all system PIDs (PID<100) for extra safety.