---
title: SwapAudit — Per-process swap and /tmp cache attribution with guarded
  cleanup for Linux — by Jad Madi (@jadmadi)
description: A single static Go binary that shows which processes and /tmp
  caches are holding swap and RAM, then reclaims them safely. It pairs a
  read-only audit with explicit, guarded cleanup and a no-reboot swap drain. No
  daemon, no telemetry, no account.
href: /project/swapaudit/
author: Jad Madi
category: Developer Tools & Infrastructure
domain: Developer Tools & CLI
status: Active CLI
license: "Dual: WaqfDPL-Mulzim 1.0 / AGPL-3.0"
year: "2026"
version: 0.2.0
---

# SwapAudit — Per-process swap and /tmp cache attribution with guarded cleanup for Linux

A single static Go binary that shows which processes and /tmp caches are holding swap and RAM, then reclaims them safely. It pairs a read-only audit with explicit, guarded cleanup and a no-reboot swap drain. No daemon, no telemetry, no account.

## Project Overview

- **Website**: https://jadmadi.net/project/swapaudit/
- **Version**: 0.2.0
- **Live Platform**: https://jadmadi.net/project/swapaudit
- **Repository**: https://github.com/jadmadi/SwapAudit
- **Documentation**: https://github.com/jadmadi/SwapAudit/blob/main/README.md
- **Domain**: Developer Tools & CLI
- **Category**: Developer Tools & Infrastructure
- **Status**: Active CLI
- **Year**: 2026
- **License**: Dual: WaqfDPL-Mulzim 1.0 / AGPL-3.0 (waqf)
- **Author**: [@JadMadi](https://x.com/jadmadi)

## Quick Install & Run

```bash
go install github.com/jadmadi/swapaudit/cmd/swapaudit@v0.2.0
```

## The Problem It Solves

Linux developer workstations accumulate swapped-out background processes and stale /tmp caches, but `free`, `top`, and `vmstat` only show aggregates.

## The Solution

Reads /proc and /tmp to rank the processes and caches responsible, then drains swap or prunes caches through explicit, guarded actions with a dry-run.

## Key Features & Capabilities

- Per-process VmSwap ranking, sortable by size, swap, RAM, or age, plus /tmp cache size and age
- Guarded no-reboot swap drain with per-device restore and a JSON receipt
- Versioned --json snapshot for scripts, statuslines, and CI
- Headless sampler and foreground watch mode with threshold notifications
- Interactive four-tier action picker with typed scope confirmation

## Technical Specifications & Architecture

- **Languages**: Go
- **Frameworks / Libraries**: Go standard library, Linux /proc
- **Architecture**: Single static binary; /proc parsers, pure planner, guarded executor; no daemon
- **License Model**: Dual: WaqfDPL-Mulzim 1.0 / AGPL-3.0

## Frequently Asked Questions

### Does SwapAudit send my data anywhere?

No. The default audit makes no network requests. `--check-updates` or `SWAPAUDIT_CHECK_UPDATES=1` performs one GitHub release request. There is no telemetry and no account.

### Which Linux architectures are supported?

amd64, arm64, armv7, and riscv64, as static binaries. `go install` works on any Linux architecture supported by Go.

### Does it kill processes automatically?

No. Cleanup requires an explicit flag. Process termination checks the real UID, PID start ticks, and orphan evidence; `--dry-run` previews every action.

## Links & References

- Project Page on Crosscurrent Code: https://jadmadi.net/project/swapaudit/
- Full Projects Directory: https://jadmadi.net/projects/
- Author Profile: https://jadmadi.net/about/
