Paging vs. Segmentation in OS

The difference between paging and segmentation in OS is that in paging, the page is of fixed block size whereas in segmentation page is of the variable block size.

Advertisement - Continue Reading Below
Paging vs. Segmentation in OS

The operating system is a bridge between user and software, in operating system memory management is one of the essential functions that allows the allocation of memory. The operating system also allocates memory and deallocate memory when the process no longer exists. Two most important concept of the operating system is paging and segmentation, in paging, the page is of fixed block size whereas in segmentation page is of the variable block size. In paging process is allowed to store in memory and is a memory management scheme. Paging gives non-contiguous memory to the process. There is no external fragmentation in paging. In paging, physical and logical memory space is divided into same side memory blocks. In paging the fixed sized blocks are known as frames and fixed size block of logical memory is called a page. In paging the process needs to be executed from logical memory space. There are two addresses that are generated by CPU in paging that are page number and page offset. In segmentation process is divided in two variable size segments and variable size segments are loaded into logical memory address space. Segmentation is memory management scheme in which page is of variable block size. Logical address space has variable size segments. There is a name and length of each segment. Segments are loaded into physical memory space. The address of physical memory space is segment name and offset. There are segment number that are used in segmentation in the place of segment name. There is an index in segmentation.

Advertisement - Continue Reading Below

Comparison Chart

Basis Paging Segmentation
Meaning In paging, the page is of the fixed block size

In segmentation, the page is of the variable block size.

 

Fragmentation In paging, there is internal fragmentation In segmentation, there is external fragmentation
Size The page size is decided by hardware in paging Segment size is decided by the user in segmentation
Table In paging, there is a page table In segmentation, there is segment table

 What is paging?

In paging process is allowed to store in memory and is a memory management scheme. Paging gives non-contiguous memory to the process. There is no external fragmentation in paging. In paging, physical and logical memory space is divided into same side memory blocks. In paging, the fixed sized blocks are known as frames and fixed size block of logical memory is called a page. In paging the process needs to be executed from logical memory space. There are two addresses that are generated by CPU in paging that are page number and page offset.

Advertisement - Continue Reading Below

What is Segmentation?

In segmentation process is divided in two variable size segments and variable size segments are loaded into logical memory address space. Segmentation is a memory management scheme in which page is of the variable block size. Logical address space has variable size segments. There are a name and length of each segment. Segments are loaded into physical memory space. The address of physical memory space is the segmented name and offset. There is segment number that is used in segmentation in the place of segment name. There is an index in segmentation.

Key Differences between Paging and Segmentation in OS

  1. In paging, the page is of fixed block size whereas in segmentation page is of the variable block size.
  2. In paging, there is internal fragmentation whereas in segmentation there is external fragmentation
  3. The page size is decided by hardware in paging whereas Segment size is decided by the user in segmentation.
  4. In paging, there is a page table whereas in segmentation there is segment table

Conclusion

In this article above we see the difference between paging and segmentation in OS with examples.

Explanatory Video

Advertisement - Continue Reading Below

Leave a Comment