Open In App

Difference Between Paging and Segmentation

Improve
Improve
Like Article
Like
Save
Share
Report

Paging: 
Paging is a method or technique which is used for non-contiguous memory allocation. It is a fixed-size partitioning theme (scheme). In paging, both main memory and secondary memory are divided into equal fixed-size partitions. The partitions of the secondary memory area unit and main memory area unit are known as pages and frames respectively. 

Paging is a memory management method accustomed fetch processes from the secondary memory into the main memory in the form of pages. in paging, each process is split into parts wherever the size of every part is the same as the page size. The size of the last half could also be but the page size. The pages of the process area unit hold on within the frames of main memory relying upon their accessibility. 

Segmentation: 
Segmentation is another non-contiguous memory allocation scheme like paging. like paging, in segmentation, the process isn’t divided indiscriminately into mounted(fixed) size pages. It is a variable-size partitioning theme. like paging, in segmentation, secondary and main memory are not divided into partitions of equal size. The partitions of secondary memory area units are known as segments. The details concerning every segment are hold in a table known as segmentation table. Segment table contains two main data concerning segment, one is Base, which is the bottom address of the segment and another is Limit, which is the length of the segment. 

In segmentation, the CPU generates a logical address that contains the Segment number and segment offset. If the segment offset is a smaller amount than the limit then the address called valid address otherwise it throws miscalculation because the address is invalid. 

 

The above figure shows the translation of a logical address to a physical address. 

S.NO Paging Segmentation
1. In paging, the program is divided into fixed or mounted size pages. In segmentation, the program is divided into variable size sections.
2. For the paging operating system is accountable. For segmentation compiler is accountable.
3. Page size is determined by hardware. Here, the section size is given by the user.
4. It is faster in comparison to segmentation. Segmentation is slow.
5. Paging could result in internal fragmentation. Segmentation could result in external fragmentation.
6. In paging, the logical address is split into a page number and page offset. Here, the logical address is split into section number and section offset.
7. Paging comprises a page table that encloses the base address of every page. While segmentation also comprises the segment table which encloses segment number and segment offset.
8. The page table is employed to keep up the page data. Section Table maintains the section data.
9. In paging, the operating system must maintain a free frame list. In segmentation, the operating system maintains a list of holes in the main memory.
10. Paging is invisible to the user. Segmentation is visible to the user.
11. In paging, the processor needs the page number, and offset to calculate the absolute address. In segmentation, the processor uses segment number, and offset to calculate the full address.
12. It is hard to allow sharing of procedures between processes.  Facilitates sharing of procedures between the processes.
13 In paging, a programmer cannot efficiently handle data structure. It can efficiently handle data structures.
14. This protection is hard to apply. Easy to apply for protection in segmentation.
15. The size of the page needs always be equal to the size of frames. There is no constraint on the size of segments.
16. A page is referred to as a physical unit of information. A segment is referred to as a logical unit of information.
17.  Paging results in a less efficient system. Segmentation results in a more efficient system.

Last Updated : 04 Jul, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads