free estadisticas Saltar al contenido

Difference between paging and segmentation in the operating system

diciembre 4, 2019

Memory management in the operating system is an essential feature, which allows the allocation of memory to processes for execution and releases memory when the process is no longer necessary. In this article, we will discuss two paging and segmentation memory management schemes. The fundamental difference between the paging and the segmentation that "page" a block of fixed dimensions while a "segment" a block of variable dimensions.

We will discuss some more differences between paging and segmentation with the help of the comparison chart shown below.

Comparative graph

Basis for confronting segmentation
BasicA page has a fixed block size.A segment of variable size.
FragmentationPaging can lead to internal fragmentation.Segmentation can lead to external fragmentation.
AddressThe address specified by the user divided by CPU into a page number and offset.The user specifies each address of two quantities, a segment number and the offset (segment limit).
Cut itThe hardware decides the size of the page.The size of the segment specified by the user.
tableThe pager involves a page table that contains the base address of each page.Segmentation involves the segment table that contains the segment number and the offset (segment length).

Definition of Paging

The paging one memory management scheme . Paging allows a process to be stored in a memory in a way not contiguous . Storing the process in a non-contiguous manner solves the problem of fragmentation external .

To implement paging, i physical and logical memory spaces they are divided into the same blocks of fixed dimensions. These blocks of fixed-size physical memory are called frame and fixed-size logical memory blocks are called pages .

When a process needs to be run, the process pages from the logical memory space are loaded into the frames of the physical memory address space. Now the address generated by CPU for access to the frame divided into two parts, or the number of page and the page offset .

There page table use the page number as an index; each process has its own separate page table that maps the logical address to the physical address. The page table contains the base address of the page stored in the physical memory space frame. The base address defined by the page table is combined with the page offset to define the frame number in the physical memory where the page is stored.

Definition of segmentation

Like Paging, also the segmentation one memory management scheme . Supports viewing the memory user. The process divided into segments of variable size and loaded into the address space of the logical memory.

The logical address space is the collection of segments of variable size. Each segment has its own first name is length . For execution, segments from the logical memory space are loaded into the physical memory space.

The address specified by the user contains two quantities, the first name of the segment and the Offset . The segments are numbered and referred to number of the segment rather than the name of the segment. This segment number is used as an index in the segment table and the value of offset decides the length or the limit of the segment. The segment number and the offset together generate the combined address of the segment in the physical memory space.

Key differences between paging and segmentation

  1. The fundamental difference between paging and segmentation is that a page will always be fixed size, while a segment has variable dimensions .
  2. Paging can lead to internal fragmentation into as the page of fixed dimensions, but it can happen that the process does not acquire the whole dimension of the block that will generate the internal fragment in memory. Segmentation can lead to external fragmentation when the memory is filled with blocks of variable size.
  3. In paging, the user provides a only whole number as the address that divided by the hardware in a page number and in Offset . On the other hand, in the segmentation, the user specifies the address in two quantities, or the segment number and the offset .
  4. The size of the page decided or specified hardware . On the other hand, the size of the specified segment user .
  5. In the paging, the page table associate the logical address to the physical address and contains the base address of each page stored in the frames of the physical memory space. However, in the segmentation, the segment table map the logical address to the physical address and contains the segment number and the offset (segment limit).

Conclusion:

Paging and segmentation are both management schemes of the memory . Paging allows you to split the memory into fixed size blocks while segmentation divides the memory space into segments of the variable block size . Where paging leads to internal fragmentation, the segmentation leads to external fragmentation .

Rate this post