DEV Community

Cover image for I Almost Bought an M5 Pro. 10 Minutes in Terminal Stopped Me.
Priyanshu Tiwari
Priyanshu Tiwari

Posted on Originally published at Medium

I Almost Bought an M5 Pro. 10 Minutes in Terminal Stopped Me.

On Saturday afternoon my Mac froze for a few seconds every time I switched windows. I posted a crying emoji about it and started looking at new Macs.

I was ready to buy a new Mac: an M5 Pro, the one I’d already been tweeting about wanting. That’s not small money when you’re 22 and building your own products.

Before paying, I asked one question: is 16GB RAM enough for programming, or was I just using it badly? I checked the numbers first. They told a different story from the one I had in my head.

What my Mac was actually doing

My laptop is an M4 MacBook Air with 16 GB of RAM. This is what it looked like that afternoon:

  • Swap used: 7.6 GB out of 9.2 GB
  • Pageouts since boot: about 640,000
  • Free disk: 14 GB, so the disk was 94% full
  • CPU: about 3.5 of 10 cores busy
  • Up for about 20 hours without a restart

The CPU was fine and the Mac wasn’t overheating. The chip wasn’t the problem.

The problem was memory. When the 16 GB fills up, macOS moves what doesn’t fit onto the SSD. That’s swap. 640,000 pageouts means my Mac had been writing RAM to disk all day. Every time I switched apps, it had to read some of it back. That’s the freeze.

And swap needs free disk space. Mine had 14 GB left, so the thing that was saving me was being squeezed too.

Is 16GB RAM enough for Claude Code? Look at what’s running, not at the code

My code is not heavy. What was heavy was everything running around it:

  • Several Claude Code sessions open at once, plus Cursor
  • A browser with tab after tab open, a terminal and a local database
  • 15 background jobs I had set up over the last month, some running all the time

I didn’t remember most of those 15. That’s the part that stung. I had been adding “small” helpers for weeks, and each one took a bit of memory that never came back.

Here’s the part nobody tells you when you buy a MacBook Air: on Apple silicon, the RAM is part of the chip. You can’t add more later. So “is 16GB enough” is really “is 16GB enough for the way I work”, because you’re stuck with the answer.

What I changed (and what it got me)

1. Cleared space first. That morning I’d asked Claude to free 30–40 GB. It found about 11 GB (old datasets and build output), took me from 10 GB to 21 GB free, then stopped and asked before touching anything it wasn’t sure about. By the afternoon I was back down to 14 GB. Swap files and caches grow back fast when you’re out of RAM.

2. Found the real space. Three folders held most of it: an old experiments folder at 24 GB, a project folder at 8.9 GB and 4.5 GB of datasets. Caches went from about 2.4 GB to 297 MB. The rule I’m keeping: leave 40 GB or more free, because swap needs room to breathe.

3. Moved heavy work off the laptop. My builds already run on a remote Mac over ssh. The big folders and the always-on jobs are moving there too, so the Air only does what I’m actively working on.

4. Fewer things at once. One editor window. Two or three Claude sessions, not five. Stop the local database when I’m not using it.

5. Restart every few days. Swap only fully clears after a reboot, and mine had been up for about 20 hours.

Small things that also help: Reduce motion and Reduce transparency in Accessibility settings, and keeping my code folder out of Spotlight so it stops re-indexing build output.

I haven’t done the restart yet, and the numbers show it. As I write this on Sunday morning, the Mac has been up for 29 hours, swap is at 6.3 GB, pageouts are past 750,000 and the disk has 16 GB free. Better than Saturday, still not where I want it. The restart is next.

So, is 16GB RAM enough for programming?

Here’s my honest answer after this week:

  • Yes, if you code in one editor, with one browser and one or two AI sessions. Web apps, Mac apps, scripts. 16 GB handles that.
  • It’s tight if you run Docker, a database and several AI agents together. It works if you keep your disk at 40 GB+ free and restart often.
  • No, if running many agents and editors at the same time is your normal day. Then 32 GB or more is the real fix, because you can’t upgrade later.

I’m in the middle group, and I was acting like I was in the third. I’m not done fixing it yet. But I know what I’m paying for now.

What I learned

When something feels slow, my first move used to be: buy the better thing.

Now my first move is: read the numbers. Swap, free disk, what’s running. It took ten minutes, and it might save me a lot of money, or at least tell me exactly what to buy when I do.

Fix the thing you have before you buy the thing you want.

If you build things and want to see more of this (the real numbers, including the embarrassing ones), I post most days on X: @priyanshudotsol.

Top comments (0)