Skip to content

Evariops/SpaceMatters

Repository files navigation

SpaceMatters

A space usage visualizer for Disks, VMs, Kubernetes and even ssh. It scans fast, shows results while it scans, and keeps memory use low.

swift macOS

Scanning a 327 GiB system volume: sortable directory outline, file-type breakdown and squarified treemap, filled in live — 4 million files in 23 seconds

What it does

Pick a disk, a cluster, a VM, and SpaceMatters maps everything inside it as a squarified treemap, next to a sortable directory outline and a breakdown by file type. The view fills in live during the scan instead of appearing at the end. Toggle between on-disk and logical sizes, and rescan just what changed when the disk moves under you.

Beyond the local disk

The home screen lists everything worth analyzing, not just volumes.

Home screen: internal disk, Low-Hanging Fruits safe cleanup, Podman virtual machines and Kubernetes contexts

  • Low-Hanging Fruits — a safe one-click cleanup pass over the usual suspects: Trash, DerivedData, npm and NuGet caches, and friends. It only ever touches locations that are safe to regenerate.
  • Virtual machines — Podman machines, scanned from inside the VM.
  • Kubernetes — pick a kube context and see every PVC by namespace, provisioned capacity against actual usage, as the same treemap.

Kubernetes view: 26 PVCs across 8 namespaces, capacity vs. used, with a per-PVC treemap

How it stays fast and lean

The scanner relies on getattrlistbulk(2), a syscall that returns many directory entries with their sizes in one call, so there is no readdir plus stat for every file. A pool of worker threads walks subtrees in parallel.

Memory stays low because the tree keeps one FSNode per directory only. Files collapse into aggregates inside their parent folder, and ExtKey packs each extension into two integers, so no String is allocated per file.

Sizes are atomic counters propagated up the ancestor chain as each directory completes, and the UI reads them ten times per second. That is what makes the live view possible.

Download

Grab the latest .dmg from the Releases page, open it, and drag SpaceMatters into Applications.

The app isn't notarized (that needs a paid Apple Developer account), so Gatekeeper blocks it on first launch. Clear the quarantine flag once and it opens normally from then on:

xattr -d com.apple.quarantine /Applications/SpaceMatters.app

Good to know

  • This project is vibe-coded.
  • Feedbacks are welcome ;)
  • The physical total matches du -skx in testing. The scan stays on the volume you picked and does not cross into mounted filesystems (swap, Preboot, external disks, DMGs), like du -x.
  • Symlinks are counted by their own size and never followed, so no cycles.
  • Files with hard links are counted once per link, as WinDirStat does.
  • Scanning system locations may require granting access. Entries that cannot be read are skipped and reported as a skipped count.
  • The treemap works at directory granularity, files aggregate into their folder. This is a deliberate memory tradeoff, and finer per file detail may come later.

Requirements

macOS 15 or later, with a Swift 6 toolchain (Xcode 16 or later).

About

Fast disk usage visualizer for macOS

Topics

Resources

License

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors