By Eric Bennett

Please send me email to report any errors in this document (technical, grammatical, or other).

The correct address of MacSlack's Internet web page is http://www.pobox.com/~ericb/software/macslack/.
Other addresses may change without notice.


The current version of MacSlack is 1.0.2 (click to download). The current version of this documentation is 1.0.2.

There is a beta version which can erase a disk with a new, empty HFS+ volume with an allocation block size of your choice. Please read the beta notes carefully before trying it.

Table of Contents


What is MacSlack?

MacSlack is a freeware drag-and-drop application that calculates how much slack space is present in a given set of files. It can also predict how much hard drive space you will regain if you split your hard disk into more partitions or convert volumes in the standard format (HFS) to the new, more efficient format (HFS+) introduced in MacOS 8.1.

If you already know why slack space is bad and how to get rid of it, you can skip down to "How do I use MacSlack?"


What is "slack space?"

In order to keep efficient track of the files on your hard drive, your Macintosh has to split the available space on your drive into chunks ("clusters" or "allocation blocks") of manageable size, as shown in Figure 1 below (white represents free space). The Macintosh can then keep track of which of these large clusters each file on your drive occupies.

The standard Macintosh filesystem (called HFS, for "Hierarchical FileSystem") can keep track of 65,536 cluster on any given volume. (A volume is a file storage area on a hard disk; most computers only have one large volume per hard disk, but you can split the disk into several small volumes instead.) On larger volumes, this means that the size of each cluster has to be larger.

Dividing the drive into large clusters as in Figure 1 usually results in wasted space. Suppose that you have a file that is 2460 characters (bytes) long, and your cluster size is 1024 bytes (such a situation is depicted for the yellow file in Figure 2 below). The Macintosh must allocate three clusters (totalling 3072 bytes) for this file even though only 2460 bytes are used. The remainder of the third cluster, called slack space, is wasted. Note that all 14 clusters in Figure 2 contain file data (represented by color); there are no free clusters, so no new files can be created on this area of the disk.

This wasted space can be a serious problem on large drives with lots of small files: the larger the drive, the larger the cluster size, and the smaller the files, the greater the amount of wasted space in each file's last cluster. If you decreased the size of the partitions on your hard drive (by splitting large partitions into multiple smaller ones), the clusters on each drive would be smaller, and you could reclaim some of the wasted space. For example, you might split the partition in Figure 2 into two smaller partitions so that the cluster size was only 512 bytes (as in Figure 3). The yellow file would take five clusters totalling 2560 bytes.

There would still be 100 wasted bytes, but 512 of the bytes that were wasted in Figure 2 are now a free cluster, which can hold a new file. On large partitions, where the cluster size can reach 32,000 bytes or more, you can lose a significant amount of space. A friend of mine discovered last year that his Windows 95 system was wasting 28% of the space on his drive for exactly this reason (the common DOS/Windows "FAT16" filesystem has the same 65,536 clusters-per-volume limit that the Mac does). The main hard drive on my own computer has one four gigabyte partition, and 25% of the space allocated to files is slack space.

How do I eliminate slack space on a Macintosh?

You can't get rid of slack space entirely. Most hard drives enforce a minimum cluster size of 512 bytes, so a 1 byte file will always be wasting the majority of the space allocated to it. However, if you can decrease the cluster size so that it is closer to 512 bytes, you will waste less space.

There are, in theory, two ways to reduce the cluster size. Each has its drawbacks. MacSlack should help you decide whether the space savings you're likely to see make it worthwhile to deal with the drawbacks.

Method 1: Use a New Volume Format

First, you can change to a different way of storing files that doesn't limit you to 65,536 clusters per disk. Operating systems that support volumes with higher limits include Windows NT, the most recent revision of Windows 95 (but not the original release), and Unix. MacOS joined this list in January, 1998, with the release of MacOS 8.1, which includes a new volume format called HFS+ (also known as "MacOS Extended Format" or "Sequoia"). The new format increases the maximum number of clusters from 65 thousand to 4 billion. The MacOS Finder can create volumes that use this format, and most third party disk formatters will be updated to support it as well.

Figure 4 below shows the actual change in disk use for an 8.4 gigabyte partition that was converted from HFS to HFS+. Note the change in the "Format" information; the left window shows the drive in Standard (HFS) format, and the right window shows Extended (HFS+) format:

Under HFS, the 4,161 items used 952 megabytes; under HFS+, they use 443. Thus, 509 megabytes were regained.

But there are potential problems with changing a drive to HFS+:

Method 2: Split Your Hard Disk Into More Partitions

Second, you can split large partitions into multiple smaller partitions. You can accomplish this with Apple HDSC Setup, Apple Drive Setup, or a third party disk formatter (examples include Hard Disk Toolkit, Silverlining, and Anubis).

Since the cluster size must always be a multiple of 512 bytes, and since there are a maximum of 65,536 clusters under HFS, you can calculate the following table:

Partition Size
(megabytes)
Cluster Size
(bytes)
1-32 512
33-64 1024
65-96 1536
97-128 2048
129-160 2560
161-192 3072
193-224 3584
225-256 4096
etc...

As you can see, the cluster size increases by 512 bytes for every 32 megabytes of partition size. If you decide to repartition your hard drive, consider this: as you can see in Figure 2, the green file has more total wasted space than the blue file, but since it is a big file, it is a smaller percentage of space wasted than the blue file. Therefore, when creating new partitions, it is a good idea to make one small partition to hold a large number of small files, while keeping one larger partition for a smaller number of large files. You could also simply make a large number of small partitions, but it then becomes more difficult to manage files (suddenly you have more free space, but it is spread around multiple partitions) and your desktop becomes more cluttered.

There are two additional drawbacks to repartitioning:

Sometimes the space savings of multiple partitions makes these drawbacks seem unimportant; in other cases these drawbacks are rather serious.


How do I use MacSlack?

Basic Operation

Drag-and-drop disks, folders, files, or a mixture of the three onto the MacSlack application. It will immediately begin to calculate the total amount of space wasted as well as the percentage of the used space that is wasted (the white space in Figure 2). You can reset the statistics or cancel the file scan using the commands in the "Operations" menu. The "Edit" menu contains a "Copy statistics to clipboard" command, which should be self-explanatory.

While the usual procedure is to drop your hard disk icon onto MacSlack, you can also calculate slack for any group of files, folders, or volumes. If you find a volume that has a lot of wasted space, you might want to inspect some of the folders on that volume individually to see whether one of them is responsible for most of the waste. If so, you may simply be able to move that directory to another, smaller drive (if you have one) and not have to repartition the entire disk.

As MacSlack is scanning folders that you explicitly told it to scan, it may encounter subfolders inside those folders. You can tell MacSlack to ignore any subfolders it encounters by un-checking the "Scan nested folders" item in the "File" menu.

There is a rudimentary help window available in the help menu (also known as the balloon help menu), but this manual is more detailed.

If You Can't Drag And Drop

Some users have not been able to drag-and-drop files onto MacSlack's Finder icon. In most cases, this means that the computer has not correctly recognized that you have a new program. You should be able to solve this problem by rebuilding the desktop file. To do so, reboot your computer, and simultaneously hold down the command (open Apple) and option keys just before the Finder and desktop appear. The Finder will ask you if you wish to rebuild the desktop file.

If rebuilding the desktop does not work, please contact me by email.

Predicting Space Savings

MacSlack can estimate how much space you would save by repartitioning your hard disk or converting your disk to HFS+ format (it does not actually perform either of these tasks). If you are interested in this information, you need to configure MacSlack before you start to scan files. Choose "Configure predictor..." from the File menu. The following window will appear:

You need to decide what type of volume you would like to use to predict space savings: Once you have chosen the size and type of volume to use, MacSlack needs to know the volume's cluster size. To make predictions based on the new cluster size, click the "Accept Current Cluster Size" button. If you decide not to change to a new size, press "Cancel."

After you have set the desired cluster size, drag and drop the desired files and folders onto the MacSlack icon in the Finder. MacSlack will predict how much space the files would occupy on the type of volume you chose. Because of the drawbacks mentioned earlier (see How do I eliminate slack space on a Macintosh?), changing to HFS+ or repartitioning your drive will not release quite as much space as MacSlack predicts. In most situations, however, the savings should be within a few megabytes of what MacSlack predicts.

Technical Asides

There is one final note for users interested in the details of HFS+. As the settings picture above states, MacSlack uses the Apple default cluster sizes for calculating HFS+ cluster sizes. Finder-formatted HFS+ volumes up to 256 MB use 0.5k clusters, volumes from 257-512 MB use 1k, volumes from 512-1 GB use 2k, and any larger volumes use 4k. Although HFS+ would allow 0.5k clusters even on volumes exceeding 1 GB, Apple decided that the increased overhead of dealing with huge numbers of tiny clusters is not likely to be worth the space savings. However, some third party disk formatting programs will probably be updated to allow you to choose settings other than the Apple defaults. If you have an Internet connection and are interested about the other benefits HFS+ will offer, you can read Apple's description of HFS+ online.

Also, note that Apple defines a megabyte as 1024 kilobytes and a gigabyte as 1024 megabytes (1,073,741,842 bytes), while most hard disk manufacturers define a megabyte as 1,000,000 bytes and a gigabyte as 1,000,000,000 bytes. MacSlack uses Apple's definition because it more accurately reflects the sizes you will see displayed by the Finder.

Silly Asides

To prevent someone from sending me email asking why I named a hard drive (see Figure 4) after the CEO of Be, Inc., I will state here that it's because I think he's a cool guy who is adding some much-needed competition to the OS market. My other drives are "Steve" and "Linus" (you figure it out :-).

Where do I get MacSlack? Are there known problems with it?

Current Version and Distribution

The current version of MacSlack is 1.0.2. See the version history (below) for changes in this release. There is a
beta version that allows you to format a volume with HFS+, and allows you to choose the allocation block size. To the best of my knowledge, this is the only freeware that will let you choose the block size.

You may redistribute the original, unmodified MacSlack archive, provided that you do not charge for this service (media and duplication costs excepted). You may not distribute MacSlack except as just described.

MacSlack can be obtained from the Info-Mac archives or from the author's web site. The MacSlack 1.0.2 distribution is available as a StuffIt archive (250k; click to download) or a BinHexed StuffIt archive (345k; click to download) . Please send any bug reports or suggestions to me by email.

Limitations, Requirements, and Known Bugs

MacSlack has the following limitations and requirements: The version history for MacSlack is:

Is the source code available?

MacSlack 1.1 is distributed under a BSD-style license. You may download the source for MacSlack 1.1 beta (180k StuffIt 5.0 archive). You are not permitted to use the code until you have agreed to the licensing terms.

Please note that MacSlack 1.0.x is not distributed under this license, and its source is not currently available.


This information was last modified on January 24, 1999.