Similarities And Differences between Paging and Segmentation.

Hello Friends, In this blog post(Similarities And Differences between Paging and Segmentation) I am going to explain to you an interesting and important topic which is to find out the similarities and differences between paging and segmentation. As we know these are the schemes for managing the memory with reference to the operating system. Now we will see how these schemes help in managing the memory.

In this blog post(Similarities And Differences between Paging and Segmentation) we are going to cover up :

Segmentation in OS
Paging in OS
Difference between paging and segmentation
Difference between internal and external fragmentation
Difference between
fragmentation and segmentation
Why paging is faster than segmentation
Difference between paging and demand paging

Similarities And Differences between Paging and Segmentation

Similarities between paging and segmentation:

Both paging and segmentation are the schemes for memory management.

In a paging scheme, the operating system must maintain a page table for each process showing which frame each page occupies. Similarly in the segmentation operating system must maintain a segment table for each process showing the base address and length of each segment.

In a paging scheme, the operating system must must maintain a free frame list. Similarly, in segmentation, the operating system must maintain a list of free holes in the main memory.

In a paging scheme, the processor uses page number and offset to calculate the absolute address. Similarly in segmentation processor uses segment number and offset to calculate absolute address.

In a paging scheme, all the pages of a process must be in main memory to run, unless overlays are used. Similarly in segmentation, all the segments of a process must be in the main memory for the process to run unless overlays are used.

Differences between paging and segmentation:

In a paging scheme, the main memory is partitioned into small fixed-sized chunks called frames. Whereas in segmentation main memory is not partitioned.

In a paging scheme, the program broken into pages by the compiler or memory management system. Whereas in segmentation program segments specified by the programmer to the compiler.

Paging suffers from internal fragmentation within frames. Whereas no internal fragmentation happens in segmentation.

NO external fragmentation occurs in paging. Whereas segmentation suffers from external fragmentation.

Quick Questions and Answers:Similarities And Differences between Paging and Segmentation-

What is Paging in OS?

Paging in OS is a memory management scheme by OS, In this paging scheme, OS fetches some pages from the secondary memory storage into primary memory which is frequently used and asked by the users. The process of data access becomes very fast with the use of this paging scheme by OS. Inside the paging scheme, the memory is divided into fixed-sized memory blocks.

Difference between paging and segmentation?

Paging and segmentation both are memory management techniques. In paging, the memory is divided into fixed-size block whereas in segmentation the memory allocation is non-contiguous.

What is the difference between internal and external fragmentation?

Internal fragmentation occurs when a process needs more or less memory to execute but we have fixed size memory block as we have in paging so here our process can not be fulfilled, this is called internal fragmentation. External fragmentation occurs when we have enough memory to fulfill a requested process but we are unable to assign the memory to the requested process as we have memory in non-contiguous form.

Why paging is faster than segmentation?

In terms of memory access or allocation, paging is much faster than a segmentation scheme. As inside the paging, the memory is divided into fixed blocks chunks whereas inside the segmentation the memory blocks are not contiguous.

What is the difference between paging and demand paging?

In the paging scheme, all the pages of a process remain in the main memory RAM whereas in the demand paging the pages which are needed into the main memory will be kept in the RAM or main memory else it will be in the physical storage or secondary memory. This is all to reduce the load on the system.

What is the difference between fragmentation and segmentation?

Both terms are associated with memory management. In fragmentation case memory blocks remains unused. And segmentation is a process to divide a process into several modules or blocks of memory or sections.

See fragmentation and its types in details..

Conclusion:

In this blog post(Similarities And Differences between Paging and Segmentation), we have gone through about segmentation in OS, paging in OS, we have learned the difference between paging and segmentation. We have seen the difference between internal fragmentation and external fragmentation. We go to know about the difference between segmentation and fragmentation. We learned the difference between paging and demand paging.

In the case of any queries, you can write to us at [email protected] we will get back to you ASAP.

Hope! you would have enjoyed this post about similarities and differences between paging and segmentation.

Please feel free to give your important feedbacks in the comment section below|Similarities And Differences between Paging and Segmentation|

Have a great time! Sayonara!

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.