Apple - Do Macs need to be defragmented?
It's not necessary. For more details than you could possibly want, read Fragmentation in HFS Plus Volumes by Amit Singh (author of Mac OS X Internals: A Systems Approach).
HFS, the filesystem Mac OS X uses (technically HFS+) has a number of built-in measures that reduce fragmentation of the drive. First, it uses extent-based allocation, which is just a fancy way of saying that it writes multiple contiguous blocks of data a time (and therefore inherently has less fragmentation of data). Second, it uses delayed allocation, meaning that disks writes are "queued" and written to the drive as a group (again, inherently less fragmentation). On top of that, Mac OS X does on the fly defragmentation of files.
The long and short is that fragmentation isn't really an issue for Macs, which is why you don't see a program to defragment drives in Mac OS X.
As a side note, there are commercial programs that will defragment drives in OS X, but this is essentially snake-oil. There might be some small level of fragmentation on your drive, and these apps will surely take care of that. But, it's 100% unnecessary, and you're unlikely to see any benefit.
Most people will tell you Macs don't suffer from disk fragmentation, citing technical arguments most people don't understand.
It's somewhat true: since there's nothing you can do about it without spending $20 on something that might not improve the performance of your computer at all, you could instead focus on other maintenance tasks and just buy a shiny new mac (or reinstall) when the old one gets too slow.
But: An important prerequisite for not caring about disk fragmentation is always keeping some free space on your disk (I couldn't find any recommendation not pulled out of thin air, but 20% is often mentioned).
And to keep the facts straight:
- There are features in Mac OS X designed to prevent some of fragmentation.
- Apple believes these features are enough to spare the majority of their users from caring about fragmentation issues, but also says you ''might'' benefit from defragmenting in some cases (e.g. "If your disks are almost full, and you often modify or create large files")
- There's no built-in or free and popular defragmenter utility for Mac OS X (although there are commercial ones)
- Some people do have issues caused by fragmentation (1, 2)
- There's no easy way to tell if your specific problem is caused by fragmentation.
BTW (@Dori's answer), the cited Fragmentation in HFS Plus Volumes explicitly says this:
Note that I do not intend to make any claims regarding the fragmentation-resistance of HFS+. I have sampled too few a volume to generalize my "results".
P.S. I know that web browsers (the field I'm interested in) are at least sometimes are affected by fragmentation (ex.: mozilla, chrome). I myself had an issue similar to the one described in mozillla's issue tracker.