Paging vs Segmentation

Nov 30 • Notes • 6155 Views • No Comments on Paging vs Segmentation

Memory management is an important matter of concern. There are two main process of this memory management to optimally utilize the memory space. Those processes are

1.     Paging

2.     Segmentation

Now let us know something about them in details.

Paging vs Segmentation

Paging 

Previously the system needed to fit the whole programs into the storage. Due to that there were many storage and segmentation problems. Then the concept of paging was introduced. In the paging system the computer memory is divided into small partitions or blocks that are all of the same size. These are referred to as page frames. Thus when a process is loaded into memory, it gets divided into small parts which we generally call as pages. These pages are of the same size as those previous frames. These process pages are then loaded into the frames. This paging process is a memory – management process as it uses the memory optimally as it does not require the memory to be contiguous. There are different paging techniques and according to them the process replaces the existing pages of the same process in case of sort of main memory. This process is one of the cause of the Virtual Memory implementation concept which is an important feature in most operating systems.

Segmentation

This process was also introduced due to the same problem for which the concept of paging came. In this process the computer memory is divided into various sizes (segments) depending on the need for address space by this process. These segments may be individually protected or shared between processes. Commonly we see some “Segmentation Faults” in programs, but we don’t understand the reason of it. This is actually because the data that is about to be read or written is outside the permitted address space of that process which leads to this fault or error. These data are accessed as each of the memory location has a reference the value of which identifies the segment along with the offset value that lies within the segment. It is having the advantage that it can be located independently and can also grow independently. But the problem with it is that the allocation of it is variable and it is very difficult to find holes in the physical memory caused due to it.

So now let us see some of the differences between the two, i.e., paging vs segmentation :

Paging vs Segmentation

Sl. No.

Paging

Segmentation

1.

Transparent to programmer (system allocates memory)Involves programmer (allocates memory to specific function inside code)

2.

No separate protectionSeparate protection

3.

No separate compilingSeparate compiling

4.

No shared codeShared code

Thus we have here discussed about one of the main topic of operating system.

I hope I was able to clear this topic. If you still have any query or any suggestion, please feel free to share it with us in the comment box below.

Tell us Your Queries, Suggestions and Feedback

Your email address will not be published.

« »