As I write this, my Mac has 7 dev servers listening on ports, two databases running, and a Next.js server on port 3000 holding 1.3 GB of memory. Everything it tracks adds up to 14.1 GB.
I only know that because I built a menu bar app to tell me. Without it, the answer is spread across terminal tabs, and you find out a server is still alive when the next one refuses to start on the same port.
The app is called PortWatch. It's open source, written in Swift, and it runs on macOS 13 or later.
What it shows
- Projects: every process started from a folder inside your projects folder, grouped by project, with its ports
- Databases and services: everything Homebrew services manages, running or stopped
- Jobs: your own launchd agents, with their state and last exit code
- Other: every other process listening on a port, collapsed by default
A server and its child processes count as one row. My Next.js server is 4 processes, and it shows as one line with one memory figure, which is the number I wanted anyway.
The menu bar item shows the number of dev servers and the combined CPU and memory. It turns orange when a process stays above 80% CPU for 30 seconds or goes over 2 GB of memory. You can change both limits in the settings.
Stopping things so they stay stopped
Killing a process by hand has two common ways to go wrong. You kill the parent and a child keeps the port. Or you kill a database that Homebrew manages, and it starts again a second later.
PortWatch stops a process with SIGTERM first, the polite signal that lets it clean up. If it's still alive after 3 seconds, the menu offers Force Kill.
Services go through their manager. A Homebrew service is stopped with brew services, and a launchd agent with launchctl, so nothing respawns behind your back. You can also stop everything in one project with one click.
Stopping a database, a third-party process, or a Claude Code session asks for confirmation first. System daemons are shown read-only, and PortWatch never asks for your password.
Build it in one command
There is no prebuilt download. The app isn't signed with an Apple Developer ID, so you build it yourself. You need the Xcode command line tools.
git clone https://github.com/NoaTubic/portwatch.git
cd portwatch
./scripts/build.sh install
open /Applications/PortWatch.app
By default it looks for your projects in the first of ~/Projects, ~/Developer, ~/Code, ~/dev, ~/src, or ~/repos that exists. Control-Option-P opens the menu from anywhere.
What it found on my machine
The binary inside the app has a --dump switch that prints what the menu would show. This is part of the output from my own Mac, with most projects cut out:
TOTAL servers 7 cpu 65.8% mem 14.1 GB alert false
blog cpu 2.1% mem 227 MB
:8765 Python server.py --host 127.0.0.1 [tree] cpu 0.2% mem 22 MB pids 1
Claude Code [claude] cpu 1.9% mem 205 MB pids 1
blog-studio cpu 0.3% mem 51 MB
:4321 python uvicorn studio.app:app --host [tree] cpu 0.3% mem 51 MB pids 2
SERVICES
:3306 mariadb [service] cpu 0.0% mem 210 MB pids 2
:5432 postgresql@16 [service] cpu 0.2% mem 96 MB pids 6
Two database servers are running side by side, MariaDB and PostgreSQL 16, each with its port and memory. The Other section, which I cut, listed 29 more entries. Most of them are editor helpers and vendor agents that listen on a port all day.
Claude Code sessions get their own row per project. A server that a session starts through a shell is a separate row, so stopping the server never kills the session.
Why it doesn't slow the Mac down
A tool that watches your CPU shouldn't be the thing using it. The simple way to build this is to run ps and lsof on a timer, which starts two new processes every few seconds, forever.
PortWatch reads process data straight from the kernel instead, through sysctl and libproc. One call returns every process on the machine. It refreshes every 5 seconds while the menu is closed and every 2 seconds while it's open.
On my machine, with about 950 processes running, it uses roughly 0.3% of one CPU core and 14 MB of memory with the menu closed.
It starts a helper process only when it has to: launchctl to read launchd state, brew services when you start or stop a service, and ps for system daemons while the Other section is open.
The same thing from the terminal
The switches work without opening the menu, which is handy in scripts:
cd /Applications/PortWatch.app/Contents/MacOS
./PortWatch --dump # print what the menu would show
./PortWatch --stop 3000 # stop the dev server on port 3000
./PortWatch --demo # run the app with made-up data
--demo is the safe way to look around before you point it at real processes.
Read this before you trust it
PortWatch sends signals to other processes and is not sandboxed. That is its job, but it's also a good reason to read the code first. It's ten Swift files.
It can only stop processes owned by your user. Processes started by an app in /Applications, such as an editor's language servers, are left out of projects, so they don't crowd the list.
Try it yourself
Build it, open the menu, and expand the Other section once. Then stop the servers you forgot about. Feedback and issues are welcome.
NoaTubic
/
portwatch
macOS menu bar app that shows your dev servers, databases and background jobs with CPU and memory use, and lets you stop them
PortWatch
A macOS menu bar app that shows your running dev servers, databases and background jobs, how much CPU and memory each one uses, and lets you stop them.
What it shows
- Projects. Any process started from a folder inside your projects folder, grouped by project, with the ports it listens on. A server and its child processes count as one row.
- Databases and services. Everything managed by Homebrew services, running or stopped.
- Jobs. Your own launchd agents, with their state and last exit code.
- Other. Every other process listening on a port, plus third-party launchd agents and system daemons. Collapsed by default.
The menu bar item shows the number of dev servers and the combined CPU and memory of everything tracked. It turns orange when a process stays above a CPU or memory limit.
What it can do
- Stop a process politely (SIGTERM), and offer Force Kill if it…

Top comments (0)