In this post, we will understand the difference between paging and segmentation in operating system −
The address space of a process is broken into fixed sized blocks.
These fixed size blocks are known as pages.
The operating system divides the memory blocks into pages.
The size of the page is determined based on the memory available.
This technique is quick in terms of memory access.
It can cause internal fragmentation since some pages would not be utilized as much as the other pages.
During the process of paging, a logical address is divided into page number and page offset.
A page table is used to store the page data.
This is how Paging works −
In this method, the address space of a process is broken down into varying sized blocks.
These varying sized blocks are known as sections.
A compiler is responsible in determining the size of the segment, the virtual address and the actual address.
The size of the section is determined by the user.
The process of segmentation is slower in comparison to paging.
It can result in external fragmentation since some memory blocks may not be used at all.
During this process, a logical address gets divided into a section number and a section offset.
A segmentation table can be used to store the segmentation data.
This is how Segmentation techniques works with Segment Map Table −