Difference Between Paging and Segmentation

Paging:

Paging is an efficient memory management scheme, it is non-contiguous memory allocation method. The basic idea of paging is that the physical memory (main memory) is divided into fixed-sized blocks that are called frames, and the logical address space is divided into fixed-sized blocks that are called pages but page size and frame size should be equal. The size of the frame or page is depending on the operating system. Generally, the page size is 4 KB.

Advantages of Paging :
1. It supports the time-sharing system.
2. It does not affect fragmentation.
3. It supports virtual memory.
4. Sharing of common code is possible.

Disadvantages of Paging:
1. This scheme may suffer ‘page breaks’.
2. If the number of pages is high, it is difficult to maintain page tables.

Segmentation:

Each process is divided into several segments, a process is loaded by loading all of its segments into dynamic partitions. Segmentation is the technique for managing these segments.

Advantages of Segmentation:
1. Segmentation supports virtual memory.
2. It allows dynamically growing segments.
3. Dynamically Linking and loading of the segments.
4. Eliminate fragmentation
5. Facilitate shared segments

Paging vs Segmentation:

Paging
Segmentation
1. The main memory partitioned into frames or blocks.1. The main memory partitioned into segments.
2. The logical address space divided into pages by MMU.2. The logical address space divided into segments by Programmer.
3. This scheme doesn't supports user view of memory. 3. This scheme supports user view of memory.
4. This scheme suffering from internal fragmentation.4. This scheme suffering from external fragmentation.
5. Processor uses the page number and displacement to calculate the absolute address (P, D)5. Processor uses the segment number and displacement to calculate the absolute address (S, D)