1. 碎片化:
分片,顾名思义,基本上是一个将空闲内存空间分成小块的过程。在这种情况下,内存块由于尺寸小而无法分配给进程,并且这些块保持未使用状态。当许多空闲块太小而无法满足任何请求时,它通常发生在动态内存分配系统中。
2.分割:
分段,顾名思义,基本上是一种内存管理技术,支持用户对内存的看法,也称为非连续内存分配技术。在这种情况下,每个进程被分为多个段,每个段的详细信息可以存储在称为段表的表中。它基本上是一个在计算机存储中为相关数据创建可变大小地址空间的过程。段的大小不固定。
OS中分片和分段的区别:
Fragmentation |
Segmentation |
---|---|
In this, storage space is used inefficiently that in turn reduce capacity and performance. | In this, memory is divided into variable size parts usually known as segments. |
Types of fragmentation includes internal and external fragmentation. | Types of segmentation includes virtual memory and simple segmentation. |
Its main purpose is to help operating system use the available space on storage device. | Its main purpose is to give user’s view of process. |
It reduces efficiency in memory management. | It simply allows for better efficiency in memory management. |
In this, memory blocks are not used i.e., it remains unused. | It usually works a memory management technique to execute processes. |
It is generally associated with IP. | It is generally associated with TCP. |
It is an unwanted problem that causes wastage of memory and inflexibility. | Its advantages include less overhead, larger segment size than actual page size, no internal fragmentation, etc. |