4

I got a MacBook Air with a limited SSD HD: 128 GB. The largest software I have is XCode (3.2 GB) and I do have 2 versions of this (4.5 and previou). My iPhoto library has 1.3GB of photos. My dropbox folder 4.3 GB and then I got some other files and folders in the computer. I do have 3 users in total but the other two users do not have any large file in their accounts (they only share Applications with the main user).

I have only 3/4 GB of memory available on my HD. How can I find out how my memory is being used? Which folder is taking most of the memory? Is there a way to segment/order the folders based on memory usage?

2
  • du -s *|sort -n | tail -10 is your friend. Jul 24, 2014 at 16:47
  • You may also want to disable local time machine backups if you have time machine enabled: sudo tmutil disablelocal. I found my CPU use would randomly skyrocket when creating a local backup, so it will save battery as well. Finally, check that you don't have any updates that haven't been installed; they download in the background and take up space.
    – usm
    Dec 11, 2014 at 10:14

6 Answers 6

6

Forget all of the other tools...use the command line!

sudo du -hd 1 /

will show you the folder sized from the root of your drive to a depth of one level.

  • du is the disk usage statistics tool
    • -h give you a "human readable" output
    • -d 1 traverses a depth of one level. This is a good starting point to see where the culprit is
    • / is the root folder

You should run this with sudo to get an accurate count and avoid permission errors. When you find your "what the heck...", change the path to that folder and investigate. For example

  • sudo du -hd 1 /what_the_heck_is_this_folder

and you'll start to get a clearer picture. Good luck.

1

Have you checked your downloads folder? Clearing that out will free up space. Surprisingly I have seen people who never empty their trash folder which can often have GB's of stuff in there. Also open iPhoto and then click the iPhoto button then Clear iPhoto trash.

All of these should free up some space.

2
  • ok well.. the iPhoto trash works. Download folder is semi-empty. Is there a way to clear the trash from iMovie?
    – mm24
    Jul 24, 2014 at 16:57
  • 1
    If you use imovie a lot to edit clips the projects can take up a huge amount of space. Deleting old projects manually and then emptying the trash is the way to "Delete the imovie trash"
    – thepiman
    Jul 24, 2014 at 17:03
1

My favourite tool for this is Disk Inventory X. It's got a fantastic graphical representation that I am struggling to describe using text. But basically it uses colour coded blocks - different colours for different types of data - and those blocks are sized according to how big the file or folder is. You can hover the mouse pointer over each block to find out the path/filename of the offending file. You can see instantly at a glance, what the biggest space hogs are. At least take a look at their web page so you can see what I mean about the user interface. It's free and I find it invaluable.

Download / read more here: http://www.derlien.com

Also, if you have an iPhone, iPod Touch or iPad, then check your iTunes sync settings - you will probably find that your iPhone (for example) gets backed up to your computer every time you sync it. I have an iPad Mini and an iPhone 5S - I see four subfolders under ~/Library/Application Support/MobileSync/Backup and they are about 15GB each.

To check for yourself, press Shift+Cmd+G while you're in Finder, and enter the folder name ~/Library/Application Support/MobileSync. Highlight the folder Backup then press Space to bring up the Quickview window (which will tell you the total size of the Backup folder).

0

Try installing GrandPerspective, which is free. It gives you a visual overview of any folder you point it at, so you can rapidly see what is consuming your disk space.

Another alternative is CleanMyMac 2, which unfortunately is not free, but you can trial it. It has a tremendous feature set, including:

  • Clear your caches and logs.
  • Lists your large files by time last accessed.
  • Strips binaries of unneeded language files.
  • Sane application removal, since OS X doesn't have a package manager.

CleanMyMac 2 has saved me gigabytes of space over the years. I can't recommend it highly enough.

0

This doesn't answer your question of "How can I find out how my memory is being used? Which folder is taking most of the memory?" (others have provided that). But I usually perform the following as free space shrinks.

  1. Clear the browser history
  2. sudo rm -rf /Library/Caches/*
  3. rm -rf ~/Library/Caches/*

~/Library/Caches/ seems to accumulate a lot of cruft over time. If you have never cleared it, then you should recover gigabytes.

0

Check out NCDU, it sorts the directories according to their size and you can delete anything from that list.
It can be easily installed via homebrew.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .