Chapter 8 Main Memory Silberschatz - Operating System Concepts 9th ( …
Silberschatz - Operating System Concepts 9th
Is a memory-management scheme that supports the idea that says that a logical address space is a collection of segments. Each segment has a name and a length.
Segment table: Each entry int the segment table has a segment base and a segment limit The segment base contains the starting physical where the segment resides in memory, and the segment limit specifies the length of the segment.
Contiguous Memory allocation
Best fit: allocate the smallest hole that is big enough. Produces the smallest leftover hole
Worst fit: allocate the largest hole. Produces the largest leftover hole, which may be useful than the smaller leftover hole from a best-fit approach
First fit: allocate the first hole that is big enough.
Compaction: the goal is to shuffle the memory contents so as to place all free memory together in one large block
To permit the logical address space of the processes to be noncontiguous.
We can prevent a process from accessing memory it does not own by combining a relocation register and a limit register
Structure of the page table
Hashed page tables
A common approach for handling address spaces larger tan 32 bits is to use a hashed page table, with the hash value being the virtual page number
Inverted page tables
The processes reference pages through the pages' virtual addresses. The operating system must then translate this reference into a physical memory address
Use a two-level paging algorithm, in which the page table itself is also paged
A process must be in memory to be executed Can be swapped temporarily out of memory to a backing store and then brought back into memory for continued execution
The backing store is commonly a fast disk
The context-switch time in such a swapping system is fairly high
Involves moving processes between main memory and a backing store
Swapping on mobile systems
iOs aks applications to voluntarily relinquish allocated memory
Android may terminate a process if insufficient free memory is available.
Typically do not support swapping in any form
Permits the physical address space of a process to be noncontiguous.
Avoids external fragmentation and the need of compaction.
Solves the considerable problem of fitting memory chunks of varying sizes onto the backing store
Breaking physical memory into fixed-sized blocks called frames and breaking logical memory into blocks of the same size called pages
Accomplished by protection bits associated with each frame Normally, these bits are kept in the page table
Consider a system that supports 40 users, each of whom executes a text editor. If the text editor consists of 150 KB of code and 50KB of data space, we need 8000 KB to support the 40 users. If the code is reentrant code (or pure code), however, it can be shared.
Daniela Porras Quiros