- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
Difference between Paging and Segmentation
Paging is a memory management technique in which process address space is broken into blocks of the same size called pages (size is power of 2, between 512 bytes and 8192 bytes). The size of the process is measured in the number of pages. Similarly, main memory is divided into small fixed-sized blocks of (physical) memory called frames and the size of a frame is kept the same as that of a page to have optimum utilization of the main memory and to avoid external fragmentation.
Similarly, main memory is divided into small fixed-sized blocks of (physical) memory called frames and the size of a frame is kept the same as that of a page to have optimum utilization of the main memory and to avoid external fragmentation.
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. Each segment is actually a different logical address space of the program. When a process is to be executed, its corresponding segmentation are loaded into non-contiguous memory though every segment is loaded into a contiguous block of available memory. Segmentation memory management works very similar to paging but here segments are of variable-length where as in paging pages are of fixed size.
A program segment contains the program's main function, utility functions, data structures, and so on. The operating system maintains a segment map table for every process and a list of free memory blocks along with segment numbers, their size and corresponding memory locations in main memory. For each segment, the table stores the starting address of the segment and the length of the segment. A reference to a memory location includes a value that identifies a segment and an offset.
Following are the important differences between Paging and Segmentation.
|1||Memory Size||In Paging, a process address space is broken into fixed sized blocks called pages.||In Segmentation, a process address space is broken in varying sized blocks called sections.|
|2||Accountability||Operating System divides the memory into pages.||Compiler is responsible to calculate the segment size, the virtual address and actual address.|
|3||Size||Page size is determined by available memory.||Section size is determined by the user.|
|4||Speed||Paging technique is faster in terms of memory access.||Segmentation is slower than paging.|
|5||Fragmentation||Paging can cause internal fragmentation as some pages may go underutilized.||Segmentation can cause external fragmentation as some memory block may not be used at all.|
|6||Logical Address||During paging, a logical address is divided into page number and page offset.||During segmentation, a logical address is divided into section number and section offset.|
|7||Table||During paging, a logical address is divided into page number and page offset.||During segmentation, a logical address is divided into section number and section offset.|
|8||Data Storage||Page table stores the page data.||Segmentation table stores the segmentation data.|
- Related Articles
- Difference between Demand Paging and Segmentation
- Difference Between Paging and Segmentation in OS
- Difference Between Paging and Swapping in OS
- What is paging?
- Region and Edge Based Segmentation
- What is Segmentation?
- Fashion Consumer Segmentation
- What is shadow paging in DBMS?
- What is Market Segmentation?
- Image Segmentation by Clustering
- Overlay an image segmentation with Numpy and Matplotlib
- Paragraph Segmentation using machine learning
- Difference Between & and &&
- Core Dump (Segmentation fault) in C/C++
- How can data mining improve market segmentation?