World Languages, asked by sharmaaditias65, 11 months ago

3. Compare Paging and Segmentation techniques in terms of (i) internal fragmentation (ii) external fragmentation

(iii) protection (iv) sharing​

Answers

Answered by seemakumarib65
0

Difference Between Paging and Segmentation in OS

December 26, 2016 17 Comments

paging-vs-segmentationThe memory management in the operating system is an essential functionality, which allows the allocation of memory to the processes for execution and deallocates the memory when the process is no longer needed. In this article, we will discuss two memory management schemes paging and segmentation.

The basic difference between paging and segmentation is that, “page” is a fixed-sized block whereas, a “segment” is a variable-sized block. We will discuss some more differences between Paging and Segmentation with the help of comparison chart shown below.

Content: Paging Vs Segmentation

Comparison Chart

Definition

Key Differences

Conclusion

Comparison Chart

BASIS FOR COMPARISON PAGING SEGMENTATION

Basic A page is of fixed block size. A segment is of variable size.

Fragmentation Paging may lead to internal fragmentation. Segmentation may lead to external fragmentation.

Address The user specified address is divided by CPU into a page number and offset. The user specifies each address by two quantities a segment number and the offset (Segment limit).

Size The hardware decides the page size. The segment size is specified by the user.

Table Paging involves a page table that contains base address of each page. Segmentation involves the segment table that contains segment number and offset (segment length).

Definition of Paging

Paging is a memory management scheme. Paging allows a process to be stored in a memory in a non-contiguous manner. Storing process in a non-contiguous manner solves the problem of external fragmentation.

For implementing paging the physical and logical memory spaces are divided into the same fixed-sized blocks. These fixed-sized blocks of physical memory are called frames, and the fixed-sized blocks of logical memory are called pages.

When a process needs to be executed the process pages from logical memory space are loaded into the frames of physical memory address space. Now the address generated by CPU for accessing the frame is divided into two parts i.e. page number and page offset.paging The page table uses page number as an index; each process has its separate page table that maps logical address to the physical address. The page table contains base address of the page stored in the frame of physical memory space. The base address defined by page table is combined with the page offset to define the frame number in physical memory where the page is stored.

Definition of Segmentation

Like Paging, Segmentation is also a memory management scheme. It supports the user’s view of the memory. The process is divided into the variable size segments and loaded to the logical memory address space.

Similar questions