

{"id":100381,"date":"2021-09-14T09:00:30","date_gmt":"2021-09-14T03:30:30","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=100381"},"modified":"2021-09-14T11:26:42","modified_gmt":"2021-09-14T05:56:42","slug":"paging-vs-segmentation-in-operating-system","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/","title":{"rendered":"Paging vs Segmentation in Operating System"},"content":{"rendered":"<p>Paging and segmentation are both storage mechanisms that help store processes. There is a very slight difference between these mechanisms.See paging vs segmentation in OS.<\/p>\n<h3>Paging in Operating System<\/h3>\n<p>Paging is a logical concept that allows the OS to retrieve processes into the main memory from the secondary storage. It provides faster access to data as processes are stored in the form of pages.<\/p>\n<p>The main system memory is divided into frames i.e., small fixed-size blocks of physical memory where the size of frames is equal to the size of pages. This provides maximum utilization of the main system memory and helps avoid external fragmentation.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-100544\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging.jpg\" alt=\"Paging in OS\" width=\"756\" height=\"534\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging.jpg 756w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging-720x509.jpg 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging-520x367.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Paging-320x226.jpg 320w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/a><\/p>\n<h4>Advantages of Paging in OS<\/h4>\n<p>Following are the advantages of Paging:<\/p>\n<ul>\n<li>The memory management algorithm is easy to use.<\/li>\n<li>External Fragmentation is not required.<\/li>\n<li>Swapping between equal-sized pages and page frames becomes easier.<\/li>\n<\/ul>\n<h4>Disadvantages of Paging in OS<\/h4>\n<p>Following are the disadvantages of paging:<\/p>\n<ul>\n<li>Internal fragmentation.<\/li>\n<li>Additional memory consumption by Page tables.<\/li>\n<li>Memory reference overhead due to multi-level paging.<\/li>\n<\/ul>\n<h3>Segmentation in Operating System<\/h3>\n<p>Segmentation is similar to paging, except that the length of segments is variable and pages have a fixed size. The segment of a program comprises the program&#8217;s main function, data structures, utility functions, etc.<\/p>\n<p>All this information about processes is maintained in the form of a segment map table by the OS. This table includes a list of segment numbers, free memory blocks, their sizes, and their memory locations in the main memory or virtual memory.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Segmentation.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-100545\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Segmentation.jpg\" alt=\"Segmentation in OS\" width=\"638\" height=\"477\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Segmentation.jpg 638w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Segmentation-520x389.jpg 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/Segmentation-320x239.jpg 320w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/a><\/p>\n<h4>Advantages of segmentation in OS<\/h4>\n<p>Following are the advantages of segmentation:<\/p>\n<ul>\n<li>Provides protection within segments.<\/li>\n<li>Segments referencing multiple processes can help achieve sharing.<\/li>\n<li>No internal fragmentation<\/li>\n<li>As compared to paging, segment tables use lesser memory.<\/li>\n<\/ul>\n<h4>Disadvantages of Segmentation in OS<\/h4>\n<p>Following are the disadvantages of segmentation:<\/p>\n<ul>\n<li>The separation of free memory space into small pieces can cause external fragmentation.<\/li>\n<li>It is costly.<\/li>\n<\/ul>\n<h3>Paging vs Segmentation in OS<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>Paging<\/b><\/td>\n<td><b>Segmentation<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Fix sized pages<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Variable sized segments<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Internal fragmentation<\/span><\/td>\n<td><span style=\"font-weight: 400;\">No internal fragmentation<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Hardware decides the page size<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The user decides the segment size<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Faster memory access<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Memory access is slower as compared to paging<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Page table stores data<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Segmentation table stores data<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Sharing of procedures is not allowed<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Sharing of procedures is allowed<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Cannot distinguish and secure procedures and data<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Can separate and secure procedures and data<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">1-D address space<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Multiple independent address spaces<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">A single integer address is divided into page number and offset by the hardware<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The user divides address in segment number and offset<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Summary<\/h3>\n<p>Paging and segmentation are both storage mechanisms that help store processes. Paging is a logical concept that allows the OS to retrieve processes into the main memory from the secondary storage. Segmentation is similar to paging, except that the length of segments is variable and pages have a fixed size.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Paging and segmentation are both storage mechanisms that help store processes. There is a very slight difference between these mechanisms.See paging vs segmentation in OS. Paging in Operating System Paging is a logical concept&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":100542,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24565],"tags":[24990,25062,25063,25064],"class_list":["post-100381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-operating-system-tutorials","tag-paging-in-os","tag-paging-vs-segmentation","tag-paging-vs-segmentation-in-os","tag-segmentation-in-os"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Paging vs Segmentation in Operating System - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn paging in Operating system, its advantages &amp; limitations. See segmentation in OS with features &amp; limitations and paging vs segmentation\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Paging vs Segmentation in Operating System - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn paging in Operating system, its advantages &amp; limitations. See segmentation in OS with features &amp; limitations and paging vs segmentation\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-14T03:30:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-14T05:56:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Paging vs Segmentation in Operating System - DataFlair","description":"Learn paging in Operating system, its advantages & limitations. See segmentation in OS with features & limitations and paging vs segmentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/","og_locale":"en_US","og_type":"article","og_title":"Paging vs Segmentation in Operating System - DataFlair","og_description":"Learn paging in Operating system, its advantages & limitations. See segmentation in OS with features & limitations and paging vs segmentation","og_url":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-09-14T03:30:30+00:00","article_modified_time":"2021-09-14T05:56:42+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Paging vs Segmentation in Operating System","datePublished":"2021-09-14T03:30:30+00:00","dateModified":"2021-09-14T05:56:42+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/"},"wordCount":469,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg","keywords":["Paging in OS","Paging vs Segmentation","Paging vs Segmentation in OS","Segmentation in OS"],"articleSection":["Operating System Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/","url":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/","name":"Paging vs Segmentation in Operating System - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg","datePublished":"2021-09-14T03:30:30+00:00","dateModified":"2021-09-14T05:56:42+00:00","description":"Learn paging in Operating system, its advantages & limitations. See segmentation in OS with features & limitations and paging vs segmentation","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/09\/OS-Paging-Vs-segmentation.jpg","width":1200,"height":628,"caption":"OS Paging Vs segmentation"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/paging-vs-segmentation-in-operating-system\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Operating System Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/operating-system-tutorials\/"},{"@type":"ListItem","position":3,"name":"Paging vs Segmentation in Operating System"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=100381"}],"version-history":[{"count":3,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100381\/revisions"}],"predecessor-version":[{"id":100546,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/100381\/revisions\/100546"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/100542"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=100381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=100381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=100381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}