The Small Wins: Freeing space on a dev machine

My laptop is very much space-constrained: 263 MB free space, out of memory

Here are some small steps I took to lighten the load. Some of the tips are Mac/Unix-specific, but most can be adapted to other platforms.

My first tip: run find ~/Downloads ~/.Trash -name "*.app" -prune -or -name "*.dmg" -prune to look for apps you don’t use. Also run DaisyDisk and OmniDiskSweeper.

Now, from what I found to be the most to the least effective:

  • Purging node_modules folders in old projects1
  • Deleting iOS device support frameworks found in ~/Library/Developer/Xcode/iOS DeviceSupport/ or just their caches in ~/Library/Developer/Xcode/iOS DeviceSupport/*/Symbols/System/Library/Caches/*2
  • npm cache clean --force
  • Removing unfinished Safari downloads (.download files)3
  • Deleting an unused AVD from ~/.android
  • nuget locals all -clear4
  • Clearing my browser cache
  • Deleting old versions of Visual Studio Code extensions in ~/.vscode/extensions (old versions seem to be retained after updates)
  • Clearing my Apple Music downloads (select all, remove download)
  • Deleting the Apple Music streaming cache at ~/Library/Caches/
  • Deleting ~/.gradle/caches
  • Clearing Spotify’s cache
  • Clearing the iTunes Album Artwork cache6
  • Deleting some old linting plugins from Atom
  • Deleting an unused system voice from the Speech preference pane
  • Clearing the Carthage package manager’s DerivedData ~/Library/Caches/org.carthage.CarthageKit/DerivedData
  • brew cleanup

  1. I’ll point you to this post on the Trilon blog, which explains how to use the find command to look for the biggest node_modules directories. ↩︎

  2. Sourced from t0rst’s Stack Overflow comment. There are some good space-saving tips for Xcode users in this post, which is linked by Jamshed Alam in response to the same question. ↩︎

  3. It’s worth mentioning that Hazel can clear these up automatically. ↩︎

  4. Sourced from rm8x’s Stack Overflow comment. You can read more about the locals command here. ↩︎

  5. Courtesy of Christian Zibreg for iDownload Blog; you can also accomplish a similar thing on iOS by toggling iCloud Music Library on and off. ↩︎

  6. This is space that'll last until you open a view that displays album thumbnails. ↩︎