📜  压缩和碎片整理之间的区别

📅  最后修改于: 2022-05-13 01:57:02.975000             🧑  作者: Mango

压缩和碎片整理之间的区别

以连续方式收集所有可用空间以使系统和内存有效运行的技术称为压缩碎片整理。但顾名思义,它们之间存在细微差别,让我们来看看这个细微差别。

压实

Compaction 是External Fragmentation的解决方案之一。目标是打乱内存内容,将所有空闲内存放在一个块中。压缩并不总是可行的。如果重定位是静态的并且在组装或加载时完成,则无法进行压缩。最简单的压缩算法就是将所有进程移到内存的一端。这个方案可能很昂贵。

碎片整理

碎片整理意味着将完整的文件存储在最少数量的连续区域中。这意味着如果该大小的连续内存可用,它会尝试将文件存储为一个完整的单元。碎片整理的工作原理是找到分散的文件碎片并将它们重新组合在一起。目的是减少文件访问时间并增加硬盘驱动器上的空间。

压缩和碎片整理的区别

S.No        

Compaction     

Defragmentation

1.Compaction is a process in which the free space is collected in a large memory chunk to make some space available for processes.It is a process that reduces the degree of fragmentation.
2.Compaction is used to reduce external fragmentation.Defragmentation reduces data access time and allows storage to be used more efficiently. 
3.Compaction is only possible if the relocation is dynamicSome operating systems automatically defragment storage periodically
4.It attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes.It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions
5.Not always easy to perform compaction.Easy to perform Defragmentation. Many tools are available like Disk Defragment etc.