Paging is a method or techniques 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 secondary memory area unit and main memory area unit known as 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 size of every part is same as the page size. The size of the last half could also be but the page size. The pages of process area unit hold on within the frames of main memory relying upon their accessibility.
Segmentation is another non-contiguous memory allocation scheme like paging. like paging, in segmentation, process isn’t divided indiscriminately into mounted(fixed) size pages. It is 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 unit known as as segments. The details concerning every segment are hold in a table known as 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, CPU generates logical address that contains 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 logical address to physical address.
Difference between Paging and Segmentation:
|1.||In paging, program is divided into fixed or mounted size pages.||In segmentation, program is divided into variable size sections.|
|2.||For 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 the comparison of segmentation.||Segmentation is slow.|
|5.||Paging could result in internal fragmentation.||Segmentation could result in external fragmentation.|
|6.||In paging, logical address is split into page number and page offset.||Here, logical address is split into section number and section offset.|
|7.||Paging comprises a page table which encloses the base address of every page.||While segmentation also comprises the segment table which encloses segment number and segment offset.|
|8.||Page table is employed to keep up the page data.||Section Table maintains the section data.|
|9.||In paging, operating system must maintain a free frame list.||In segmentation, operating system maintain a list of holes in main memory.|
|10.||Paging is invisible to the user.||Segmentation is visible to the user.|
|11.||In paging, processor needs page number, offset to calculate absolute address.||In segmentation, processor uses segment number, offset to calculate full address.|
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Difference between Demand Paging and Segmentation
- Difference between Paging and Swapping in OS
- Two Level Paging and Multi Level Paging in OS
- Paging in Operating System
- Multilevel Paging in Operating System
- Translation Lookaside Buffer (TLB) in Paging
- Segmentation in Operating System
- Difference between C++ and Go
- Difference between MP4 and MP3
- What is the difference between GUI and CUI?
- Difference Between DVD-R and DVD+R
- Difference between Blu-ray and DVD
- Difference between GSM and LTE
- Difference between DVD-R and DVD-RW
- Web 1.0, Web 2.0 and Web 3.0 with their difference
- Difference between AIX and IBM i
- Difference between AIX and HP-UX
- Difference between PNG and GIF
- Difference between SQL and T-SQL
- Difference between AIX and QNX
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ashushrma378