Fragmentation is a problem that develops subtly. The aftermath of severe file system fragmentation is inefficient use of disk space and consequently poor performance. There could be different types of fragmentation depending on the storage allocation scheme used by the OS. In general, fragmentation is classified into three types: internal, external, and data. Internal fragmentation differs from the other two kinds of fragmentation and OS X has built-in safeguards to counter it. The following discussion will give you an insight into internal fragmentation.
This type of fragmentation occurs when the memory blocks allocated for file storage contain wasted space. Typically, memory is allocated in chunks and each chunk has a size that corresponds to a multiple of 4. The smallest chunk can be a single block with size 4 KB (if the volume size is greater than 1 GB). In OS X’s HFS+ or any other file system, files are usually stored beginning at the start of a sector. This simplifies the organization of files on the hard drive. If a file requires 23 KB of disk space for storage, it will be in fact allocated one chunk of 24 KB size. Thus, 1 KB of memory space is left unused or wasted. This space is known as slack space and thus the name ‘Internal’ fragmentation.
Slack space can be defined as the space left unused inside an allocated region of memory. You can also say that slack space is the memory space between the last byte occupied by the file and the starting byte of the next sector. Similarly, when memory is allocated to a program, it may get some additional disk space for alignment or metadata storage. As a consequence, some allocated space is left unused, which adds to internal fragmentation.
Internal fragmentation may become severe gradually as more and more files are stored. At some point in time, your hard drive will become highly fragmented. This may cause slowdowns and sluggish behavior of Mac. It is difficult to prevent or fight internal fragmentation. If you want to put a check on this, you can do so by an effective design change.
OS X uses a built-in mechanism to facilitate delayed memory allocation. Delayed memory allocation allows combining a set of small allocations into a single large allocation. When two or more than two files are allocated contiguous blocks of memory, the amount of slack space generated is comparatively less. This helps to prevent internal fragmentation from occurring in the first place.
You can also use a number of advanced Mac hard drive defragmentation tools for the same purpose. These utilities reorganize files stored on your OS X drive and removes all slack space generated due to internal fragmentation. These software can also help to fix external fragmentation of the file system.
Guest article written by: Vishal is an enthusiastic Mac user and writer willing to explore several areas of hard drive optimization, removing Mac hard drive slacks is one of those optimization technique.
Related articles you might find interesting:
- None Found!