I connected to my Xserve the other day to check on something, only to see the dreaded "The startup disk is almost full" error message. Mac OS X doesn't like running low on disk space, so I immediately went looking for the culprits. I was trying to track a crashing problem in the current Web Crossing build, and it had indeed created a 1.3 GB core dump after a crash, leaving me with only 440 MB free on my 60 GB disk. But even after I archived the core dump to the Xserve's second drive, sent it to the developers, and deleted the core file, I had only 1.8 GB of free space, which is still pretty tight. Curious as to what was chewing up the space, I turned to a pair of free tools I often find myself using in this situation: the open source GrandPerspective and id-design's free WhatSize.
I like to use GrandPerspective first, because it shows a graphical map of how disk space is being used, with the rectangle size corresponding to file size. So, as you can see, my server's disk has some really large files on it. Unfortunately, I forgot to take the screenshot before deleting files (I had server disk health on my mind at the time, not an article). With GrandPerspective, it's trivial to see when a couple of very large files are responsible for the disk filling up; it's less useful if you have a huge number of smaller files. When you mouse over a rectangle, GrandPerspective shows you its path; if you click a rectangle to select it, you can then click a Reveal button to display the file in the Finder. Filters enable GrandPerspective to limit its view to just files of certain types or sizes, which could be helpful in some situations.
However, when I need to focus on the specific directories and files that can be pruned to recover disk space, I switch over to WhatSize. By default, it uses a Mac OS X-like column view, with files and folders sorted by size, rather than name, although it also offers a number of other views that I don't find useful. You can also move files and folders to the Trash from within WhatSize.
I'm sure there are plenty of other applications that aim to shine light into the dark corners of your hard disk (including a new one in beta, called Baseline, that promises to show you just the files that have changed since a previous scan was saved), but you won't go wrong with GrandPerspective and WhatSize. Neither is particularly speedy at scanning your disk initially, but otherwise they work as advertised. And since both are free, there's no excuse for not trying them the next time you need to free up some disk space. Oh, and the culprits on my server? Back in August I had repacked the multi-gigabyte Web Crossing database, and to be safe, I had retained all the copies generated during that process. Deleting them freed up about 16 GB of space. Server crisis averted.