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
Bitcoin news: BlackRock iShares ETF listed on the DTCC
Ways Of Surviving and Profiting During Bear Markets
Xre-02022
Kevin Cox Picks
Washu Parking
فیلم رهگیر دوبله فارسی بدون سانسور نماشا
Voorraad - Foodtrailers
How Quickly Do I Lose My Bike Fitness?
Echo & the Bunnymen - Lips Like Sugar Lyrics
Huge Boobs Images
Bitlife Tyrone's
Aldi Sign In Careers
Q33 Bus Schedule Pdf
Craigslist Pet Phoenix
Beverage Lyons Funeral Home Obituaries
Phoebus uses last-second touchdown to stun Salem for Class 4 football title
Https Paperlesspay Talx Com Boydgaming
Johnnie Walker Double Black Costco
U Of Arizona Phonebook
Great Clips Grandview Station Marion Reviews
Little Rock Skipthegames
Craigslist St. Cloud Minnesota
Kroger Feed Login
Random Bibleizer
Feathers
Jurassic World Exhibition Discount Code
Dexter Gomovies
Spirited Showtimes Near Marcus Twin Creek Cinema
Mchoul Funeral Home Of Fishkill Inc. Services
Jail Roster Independence Ks
Grays Anatomy Wiki
Half Inning In Which The Home Team Bats Crossword
Matlab Kruskal Wallis
Orange Pill 44 291
Song That Goes Yeah Yeah Yeah Yeah Sounds Like Mgmt
Luciipurrrr_
Barrage Enhancement Lost Ark
Rocketpult Infinite Fuel
Gold Nugget at the Golden Nugget
Pinellas Fire Active Calls
Troy Gamefarm Prices
Bernie Platt, former Cherry Hill mayor and funeral home magnate, has died at 90
Beaufort SC Mugshots
ESA Science & Technology - The remarkable Red Rectangle: A stairway to heaven? [heic0408]
Post A Bid Monticello Mn
Walmart 24 Hrs Pharmacy
Dicks Mear Me
2000 Ford F-150 for sale - Scottsdale, AZ - craigslist
Costner-Maloy Funeral Home Obituaries
Game Akin To Bingo Nyt
Https://Eaxcis.allstate.com
Yoshidakins
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.