Paged Segmentation and Segmented Paging


Paged segmentation and segmented paging are two methods that operating systems use to manage computer memory allocation and address translation.

Paged segmentation is a hybrid memory management scheme that combines segmentation and paging. Memory is divided into segments of different sizes, which are further divided into pages of fixed sizes. A segment table tracks segment location and size, while a page table tracks page location and corresponding physical addresses. When a program requests memory, the operating system allocates a segment of the required size and divides it into pages.

Important aspects of paged segmentation

  • Modern operating systems manage the memory of a computer system using a technique called paged segmentation. It is a technique for segmenting a computer's main memory into fixed-size pages and managing the mapping between logical addresses and physical locations using a table.

  • Depending on the hardware platform and operating system, the page size can change, however, it is commonly 4KB or 8KB.

  • The operating system keeps track of the mapping between logical addresses and physical addresses via the page table. An operating system must fetch the page from secondary storage (such as the hard disc) and load it into the main memory when a program attempts to access a page that isn't currently in the main memory. Page switching or paging is the name of this procedure.

  • The usage of virtual memory, a method that lets programmes access more memory than is actually accessible in the system, is made possible via paged segmentation. When the main memory is full and a new page needs to be loaded, the operating system must first make room for it by evicting one from the main memory.

  • Based on several factors, including the page's size, age, and frequency of access, the page replacement algorithm chooses which page to remove.

  • Overall, paged segmentation is an effective method for controlling a computer system's memory since it allows for the efficient use of memory and the usage of virtual memory.

Advantages and Disadvantages of Paged Segmentation

A memory management strategy called paged segmentation combines segmentation with paging. Paged segmentation divides the memory into variable-sized segments, and then further divides each segment into fixed-sized pages. The followings are some benefits and drawbacks of paged segmentation.

Advantages

Memory can be used more effectively when it is segmented into fixed-sized pages and segments of varying sizes thanks to paged segmentation. By permitting variable-sized segments, this technique offers flexibility in memory management, leading to better memory management. Paged segmentation also enables page switching between main memory and secondary storage for better memory management and provides page-level security against unauthorized access to memory. It is a popular option for contemporary operating systems since it is also simpler to implement than pure segmentation.

Disadvantages

The system will allocate a complete page to a process when it needs memory that is not an exact multiple of the page size, wasting RAM. Internal fragmentation is the name given to this squandered memory. The memory management system becomes more complex as a result of paged segmentation. In comparison to alternative memory management strategies, such as pure segmentation or pure paging, managing segments and pages simultaneously necessitates the use of more complex algorithms and data structures. Paged segmentation can cause a longer time to move between contexts since the system must update the page tables for each process that is switched in and out of the memory. External fragmentation is the result of the system having to shift some pages in and out of secondary storage when there is not enough physical memory to hold all the pages needed by a process.

Paged segmentation provides advantages overall, but it also has some disadvantages that should be properly taken into account when creating a memory management system for an operating system.

What is Segmented Paging?

A memory management strategy that combines segmentation with paging is called segmented paging. Memory is partitioned into segments of different sizes after being originally segmented into pages of set sizes. A segment table tracks segment location and associated physical addresses, whereas a page table tracks page location and size. The operating system allows a page of the requisite size and breaks it into segments when a program demands memory.

Important aspects of Segmented paging

  • To effectively manage memory in contemporary computer operating systems, segmented paging is a memory management strategy that combines the benefits of segmentation with paging.

  • It assigns each page to a corresponding page frame in physical memory and divides a process's logical address space into segments of varying widths.

  • To translate logical addresses into physical addresses and to offer granular memory security against unauthorized access, page tables are used.

  • By allocating memory in short, variable-sized segments, segmented paging makes optimum use of the available memory and prevents fragmentation, enabling effective memory management.

Advantages and Disadvantages of segmented paging

Advantages

Operating systems employ segmented paging as a memory management technique to control how much memory is allotted to active programmes. This system divides a programme's logical address space into segments, and then further into fixed-sized pages for each segment. The following are some benefits of segmented paging −

Flexibility

Compared to pure paging, segmented paging offers more flexibility in controlling memory allocation. Each programme in segmented paging may consist of several segments, each of which may vary in size. This decreases waste and enables more effective use of memory resources.

Protection

Segmented paging shields each programme's memory from harm. Each segment may have its own set of access controls and levels of security to guard against unauthorised access and change.

Memory sharing

Segmented paging enables memory sharing between applications. The ability for many programmes to share a segment allows them to share data and code, which can help decrease redundancy and free up memory. Segmented paging permits dynamic memory allocation, which enables memory to be allocated and deallocated as necessary and enables more effective use of memory resources.

Virtual memory

Segmented paging is frequently used in virtual memory systems, allowing the operating system to consume more memory than the device's physical memory can hold. To do this, some of the less often used data and code are temporarily stored on the hard drive and only loaded into memory when necessary.

Disadvantages

Segmented paging is a memory management strategy that combines segmentation and paging's benefits. It has some advantages, but it also has some drawbacks. The following are a few drawbacks of segmented paging −

Fragmentation

Memory fragmentation is a potential side effect of segmented paging. Memory fragmentation can result from idle space between segments caused by the possibility of varied segment sizes.

Complex Address Translation

Compared to pure paging or pure segmentation, segmented paging necessitates more sophisticated address translation techniques. The logical address must first be converted into a segment number and an offset within the segment, after which the segment number must be converted into a physical address.

Overhead

Additional hardware and software overhead is needed for segmented paging to maintain the page tables and segment tables. Performance may suffer and system overhead may rise as a result.

Limited address space

Segmented paging may also place restrictions on the amount of address space that a process can access. The size of the segment table, which might restrict the total amount of memory that can be accessed, determines the maximum size of a segment.

Conclusion

The segmented paging strategy and the paged segmentation strategy are both intricate memory management strategies that require a lot of hardware support in order to function efficiently. Due to the efficient and adaptable memory management provided by modern operating systems, multiple programs can run simultaneously on a computer system due to the efficient and adaptable method of managing memory.

Updated on: 20-Jul-2023

637 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements