Paging and segmentation are memory management techniques. Both plays basic functions in the operating system. They provide support to RAM, as every computer cannot work solely by just using RAM for processes, paging and segmentation are used so the computer can utilize the storage disk for additional support to RAM.
What is the difference between paging and segmentation?
Differences between paging and segmentation:
Paging technique facilitates RAM with additional memory known as virtual memory. The process is done through by plotting pages to frames in the RAM.
Paging divides the memory into blocks of similar size which are then mapped over the frames of RAM. Size of the page in paging is usually determined by computer hardware.
The paging is faster as compare to segmentation. Internal fragmentation can occur as a result of paging. Logical address, the address that is created by RAM for every active process which can be then mapped on physical location in RAM, as paging is divided into page offset and the page number. It includes a page table which has every page’s base address. Page table has the responsibility to maintain page data.
In paging, OS has the responsibility to must preserve the free frame list. Paging is unseen to users. To calculate the absolute address in the paging processor, it will require the page number and offset. In paging, the operating system is responsible for the process. In paging procedure and data cannot be separately distinguished and protected. The entire program compiling will be required if there is a change in data or procedure.
Segmentation is also the same process as paging where support to the RAM is being provided by utilizing storage disk. In segmentation, the memory is divided into variable-size blocks, and these blocks are known as sections. The users determine the size of the section in segmentation. The process of segmentation is slow as compare to paging. The external fragmentation occurs as a result of segmentation.
Logical address in segmentation is divided into section offset and section number. Segmentation also includes a segment table which has the segment offset and segment number. Segment table also has the responsibility of maintaining sections data.
In segmentation operating system has the responsibility of managing a list of holes in main memory. Segmentation is visible to users. The processor will require a section number and offset to calculate the absolute address, in segmentation.
A compiler is accountable for the segmentation process. In segmentation, the procedure and data can be separately distinguished and protected. No entire compilation of program is required in segmentation in case of any change in data or procedure.