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.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- 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 DFA and NFA
- Difference between WCF and Web API
- Difference between BFS and DFS
- Difference between DAS and NAS
- Difference between H.323 and SIP
- Difference between ELT and ETL
- Difference Between SEO and SEM
- Difference between SSH and SSL
- Difference between T-SQL and PL-SQL
- Difference Between GIT and SVN
- Difference between PIP and HLP
- Difference between USB 2.0 and USB 3.0
- Difference between Tor and VPN
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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