Difference between Demand Paging and Segmentation (2024)

DifferencesComputersMemory

Both Demand Paging and Segmentation are memory management techniques used in operating systems. In Demand Paging, a page is loaded from the secondary memory into the primary memory, only when it is needed. On the other hand, Segmentation follows a strategy whereby the entire memory space is divided into discrete segments and each segment is allocated to a process. Read through this article to find out more about Demand Paging and Segmentation and how they are different from each other.

What is Demand Paging?

As the name suggests, Demand Paging swaps a page into the main memory only when it is demanded by the CPU. The space available in primary memory is limited and at any given time, it has to run several processes simultaneously and each of these processes require some pages (not all of it) to be fetched from the secondary memory. For example, let's suppose you are using MS-Excel and it occupies 300 MB of space in the secondary memory, however it may not require all of it to be present at a time in the primary memory. Hence, the primary memory fetches only those pages which the CPU demands in order to run a specific process.

Demand Paging is also known as "Lazy Swapping" because it swaps pages lazily from the secondary memory, and only when they are demanded by the CPU.

Advantages of Demand Paging

Demand Paging supports efficient memory utilization. It never fetches those pages into the primary memory that are not required by the CPU. In Pure Demand Paging, a process starts without any pages in the primary memory and as soon as the process starts executing, the CPU triggers a page fault, whereby the requires pages are fetched from the secondary memory.

Disadvantages of Demand paging

Although Demand Paging improves memory utilization, the memory access time is normally longer. In addition, it creates more overheads due to interrupts and page tables.

What is Segmentation?

Segmentation is another memory management technique, just like Paging, that divides the addressable memory in distinct segments. However, there is a difference between a Page and a Segment. While Paging divides the memory into blocks of fixed size, Segmentation divides the memory into segments of variable sizes that can grow or shrink as per requirement. A computer that uses segmentation as the memory management technique would have a logical address space that can be viewed as multiple segments.

Advantages of Segmentation

Segmentation supports user's view of memory by dividing a process into modules that provide better visualization. There is no internal fragmentation in Segmentation. A Segment Table keeps track of all the segments, which occupies less space as compared to an equivalent Paging Table that keeps a record of all the pages.

Disadvantages of Segmentation

Segmentation is an expensive technique because it involves a lot of overhead for maintaining a separate segment table for each process. Since the segments are of unequal length, they are not suitable for swapping. Segmentation leads to external fragmentation as the available memory space is broken down into smaller chunks as the processes are being loaded and removed.

Difference between Demand Paging and Segmentation

The following table highlights the major differences between Demand Paging and Segmentation −

KeyDemand PagingSegmentation
DefinitionPaging is a memory management technique in which process address space is broken into blocks of the same size called "pages".Segmentation is a memory management technique in which each job is divided into several segments of different sizes, one for each module that contains pieces that perform related functions.
Block SizeThe block size is fixed in case of Demand Paging.In Segmentation, the process address space is broken in varying sized blocks which are called as "sections". So block size is not fixed in case of Segmentation.
Block size dependencyIn Demand Paging, the size of blocks is dependent on system memory and gets assigned accordingly. In Segmentation, the size is not dependent on system memory and is all up to user's choice that of what size blocks are needed.
PerformanceIn context of performance, Demand Paging is faster as compared to Segmentation.Segmentation is slower in speed as compared to Pagination.
Data Load In case of Demand Paging, pages get loaded in the main memory at runtime when the user demands it.In case of Segmentation, all the sections get loaded at the time of compilation.
Data Record In Demand Paging, there is a Page map table that manages the record of pages in memory.In case of Segmentation, there is a Segment map table that manages every segment address in the memory.

Conclusion

The most important point that you should note here is that Paging is a faster technique than Segmentation. In Paging, the pages are of fixed size and it is decided by the hardware. In contrast, the size of segments in Segmentation can vary as per the user's requirements.

Kiran Kumar Panigrahi

Updated on: 24-Nov-2022

5K+ Views

  • Related Articles
  • Difference between Paging and Segmentation
  • Paged Segmentation and Segmented Paging
  • Difference Between Paging and Swapping in OS
  • Difference between Aggregate Demand and Aggregate Supply
  • Demand Curve and The Law of Demand
  • Meaning of Demand and Factors Affecting Demand
  • Segmented Paging
  • What is paging?
  • Need for Paging
  • Performance of Paging
  • Region and Edge Based Segmentation
  • Demand
  • What is Segmentation?
  • Fashion Consumer Segmentation
  • Multilevel Paging in Operating System
Kickstart Your Career

Get certified by completing the course

Get Started

Difference between Demand Paging and Segmentation (2)

Advertisem*nts

Difference between Demand Paging and Segmentation (2024)
Top Articles
Technical Analysis That Indicates Market Psychology
Being Too Active or Passive – International Counseling
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Selly Medaline
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 6623

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.