Fragmentation (computing)¶
A computing-storage layout mismatch in which allocation leaves unusable slack inside units, disperses free capacity below a request's contiguity need, or scatters one file across nonadjacent extents.
Core Idea¶
Computing fragmentation is a mismatch between how finite storage is divided or placed and how a workload needs to use it. It has distinct forms. Internal fragmentation leaves unusable slack inside an allocated unit—for example, TCMalloc may round a 15-byte request to a 16-byte class. External fragmentation leaves free memory in runs unsuitable for a particular contiguous request even though their total may be large. File-data fragmentation places one logical file in separated extents; the file may still be fully readable, and any performance cost depends on storage device and access pattern.[tcmalloc][ref-81300b00fa8c][^ref-e073a1a789e8]
The shared question is not simply “how much space is free?” It is which allocation grain or placement conflicts with which size, contiguity or locality demand? Each subtype has its own measurement and may call for a different remedy. Compaction and defragmentation are responses, not required parts of the phenomenon.
Scope of Application¶
Heap allocators reveal internal waste through request-size rounding and possible external limitations through available contiguous spans. TCMalloc reports size classes and page-heap free-span distributions; GNU libc describes coalescing adjacent freed chunks to reduce waste.[tcmalloc][ref-2799ebbf3dcf] In a filesystem, file extension can lead to nonadjacent block placements. Ext4 uses multiblock and delayed allocation to favor locality. On rotating drives, scattered blocks may cause head movement; on SSDs, locality can affect transfer sizes and request counts without mechanical seeks.[ref-81300b00fa8c][ref-e073a1a789e8]
Virtual memory can map scattered physical pages into a contiguous virtual range, changing the constraint rather than abolishing fragmentation. Linux still documents physically contiguous allocations for some huge-page and device-buffer uses and employs compaction where possible.[^kernel]
Clarity¶
The subtype determines the test. Compare requested bytes with assigned slot size for internal slack; total free space with the sizes of available free runs for external fragmentation; file extents with an actual read path for file-data fragmentation. A memory leak is different: storage remains claimed after it should have been released, whereas externally fragmented storage is available but badly arranged for a request. Deliberate chunking or partitioning is not fragmentation merely because data has pieces.[tcmalloc][ref-81300b00fa8c]
Manages Complexity¶
The concept brings three seemingly different symptoms—unexpected memory footprint, a failed large contiguous request, and possible locality-sensitive file I/O—under one layout-versus-demand question without flattening them into one metric. An allocator's peak-overhead statistic cannot by itself count extents in a file; a file's extent count does not measure unused bytes inside live heap allocations.[tcmalloc][ref-e073a1a789e8]
Abstract Reasoning¶
Locate the level at which placement occurs: object slot, free page span, physical frame, or filesystem extent. Then identify what the next use requires. Rounding a small object calls for an internal-slack calculation. A large memory request calls for a contiguous-run check. Reading a separated file calls for a device- and access-specific locality assessment. Only after identifying the subtype should one compare remedies such as a different allocation grain, coalescing, compaction, preallocation, or filesystem defragmentation.[tcmalloc][ref-2799ebbf3dcf][^ref-e073a1a789e8]
Knowledge Transfer¶
The same structure appears in a heap and in file storage: finite addressable units, a placement/granularity rule, a demand, and a mismatch that makes a simple capacity total misleading. But the units and effects remain computer-specific. Live Memory Management is a neighboring memory practice that lists fragmentation as one failure; it is not a parent of file-data fragmentation. Live Allocation requires competing claimants, not necessarily present in a single rounded allocation or file; no strict parent edge is staged. A broader cross-domain “layout versus downstream use” skeleton remains a future-prime question, not an assumed prime identity.
[^tcmalloc]: Google, TCMalloc: Understanding Malloc Stats, “Page Sizes,” “Per Size-Class Information,” and “Pageheap Information.” https://google.github.io/tcmalloc/stats.html
[^ref-2799ebbf3dcf]: GNU C Library Reference Manual, “Efficiency Considerations for malloc,” §3.2.2.6. https://sourceware.org/glibc/manual/2.23/html_node/Efficiency-and-Malloc.html
[^ref-81300b00fa8c]: GNU C Library Reference Manual, “Storage Allocation,” §14.10.11. https://sourceware.org/glibc/manual/2.43/html_node/Storage-Allocation.html
[^ref-e073a1a789e8]: Linux kernel documentation, “Block and Inode Allocation Policy,” ext4. https://docs.kernel.org/filesystems/ext4/allocators.html
[^kernel]: Linux kernel documentation, “Concepts overview,” Virtual Memory Primer and Compaction. https://docs.kernel.org/5.10/admin-guide/mm/concepts.html
Neighborhood in Abstraction Space¶
Fragmentation (computing) sits in a moderately populated region (54th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.
Family — Unclustered & Miscellaneous (2551 abstractions)
Nearest neighbors
- Buffer Overflow — 0.87
- Position-Independent Code — 0.86
- Hierarchical Storage Management — 0.86
- Memory Management — 0.86
- Cache-Only Memory Architecture — 0.85
Computed from structural-signature embeddings · 2026-10-08