Comparative Analysis of Operating System Memory Management (Linux, Solaris, W2K)
Classified in Computers
Written on in
English with a size of 3.34 KB
Memory Management in Linux
Page Allocation Mechanism
Linux defines a mechanism for dealing with contiguous blocks of pages corresponding to blocks of contiguous page frames in main memory. For this, it uses the buddy system, where the kernel maintains a list of groups of contiguous page frames of fixed size.
Page Replacement Algorithm
The Linux page replacement algorithm is based on the Clock algorithm (also known as NUR or NRU), which associates a use bit and a modification bit with each page in main memory.
Memory Management in Solaris
Paging System
Machine-Independent Data Structures
For paged virtual memory, Solaris uses a series of data structures that are independent of the machine:
- Page Table: Each process has a table with an entry for every virtual memory page belonging to that process.
- Descriptor Disk Blocks: For each page associated with the process, there is an entry in the page table that describes the disk copy of the virtual page.
- Page Frame Table: Describes each frame of real memory and is indexed by the frame number.
Page Replacement in Solaris
The page replacement algorithm used in Solaris is called the Two-Needle Clock Algorithm. It uses a reference bit for each memory page that meets the requirements (i.e., is not blocked) to be evicted. Two parameters determine the operation of the algorithm:
- Travel Speed: The speed (in pages per second) with which the "hands" move through the list of pages.
- Range Between Needles: The space separating the front and back needles.
Memory Management in Windows 2000 (W2K)
The Virtual Memory Manager (VMM) in Windows 2000 (W2K) controls how memory is allocated and how paging is performed.
W2K Virtual Address Map
Each Windows 2000 user process has a separate 32-bit address space, allowing for 4 Gbytes of memory per process. A portion of this memory is reserved for the operating system, leaving each user process with 2 Gbytes of available virtual address space.
Paging Implementation in W2K
When a process is created, it can, in principle, use any part of the 2 Gbytes of user space. This space is divided into fixed-size pages, and any page can be loaded into main memory.
A maximum size for the Working Set (WAS) is set, depending on the size of the RAM.
When a page fault occurs, the requested page is loaded, along with a small number of surrounding pages. This mechanism is called demand paging with clustering (or simply clustering).
If memory is full, the system may use an LRU replacement policy (to move pages to disk) or a FIFO policy (where pages are taken out of the Working Set but remain in physical memory).
Threads and Page Fault Handling
Page fault behavior depends on the threading model used by the program: One-to-One, Many-to-One, or Many-to-Many.
- In the Solaris kernel, Lightweight Processes (LWPs) produce page faults (PF) separately.
- In Linux, threads can also produce page faults separately.
- The situation in Windows NT is similar to Linux.