Difference between Demand Paging and Segmentation (original) (raw)

Last Updated : 12 Jul, 2025

Demand Paging is another segmentation technique which is used in operating system to manage system resources. It is therefore important for those who would understand various aspects of operating systems to have a clear distinction between them. This article shall provide a description of what each technique entails, Their pros and cons as well as a comparison between the two in order to establish which is best suited in different circumstances.

What is Demand Paging?

Demand paging is identical to the paging system with swapping. In demand paging, a page is delivered into the memory on demand i.e., only when a reference is made to a location on that page. Demand paging combines the feature of simple paging and implement virtual memory as it has a large virtual memory. Lazy swapper concept is implemented in demand paging in which a page is not swapped into the memory unless it is required.

Advantages of Demand Paging

Disadvantages of Demand Paging

**What is Segmentation?

Segmentation is the arrangement of memory management. According to the segmentation the logical address space is a collection of segments. Each segment has a name and length. Each logical address have two quantities segment name and the segment offset, for simplicity we use the segment number in place of segment name. The difference between Demand Paging and Segmentation are as follows:

Advantages of Segmentation

Disadvantages of Segmentation

Difference between Demand Paging and Segmentation

Demand Paging Segmentation
In demand paging, the pages are of equal size. While in segmentation, segments can be of different size.
Page size is fixed in the demand paging. Segment size may vary in segmentation as it grants dynamic increase of segments.
It does not allows sharing of the pages. While segments can be shared in segmentation.
In demand paging, on demand pages are loaded in the memory. In segmentation, during compilation segments are allocated to the program.
Page map table in demand paging manages record of pages in memory. Segment map table in segmentation demonstrates every segment address in the memory.
It provides large virtual memory and have more efficient use of memory. It provides virtual memory and maximum size of segment is defined by the size of memory.
Virtual memory is divided into pages. Virtual memory is divided into segments.
Size of Unit of demand Paging Pages can be of equal or variable size. Size of Unit of segmentation Segments are variable in size.
Memory allocation of Pages are allocated dynamically. Memory allocation of Segments are allocated at the process start.
Memory access is Page-level protection. Memory access is segment-level protection.
Memory wastage is Internal fragmentation. Memory wastage is external fragmentation.
Paging algorithm is Demand Paging. Paging algorithm is non- demand Paging(Fixed Allocation).

Conclusion

Like all other methods, Demand Paging strives towards efficient memory control for different processes, but it stands as different from Segmentation method since it has its own advantages and disadvantages. Demand Paging is beneficial to reduce the amount of memory consumed and loading time and on the other hand, Segmentation is more conceptual and practical in terms of memory organization. This is important because depending on the specifics of the system or the application being developed one approach or the other might be more effective.