Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1

Size: px
Start display at page:

Download "Main Memory. Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1"

Transcription

1 Main Memory Electrical and Computer Engineering Stephen Kim ECE/IUPUI RTOS & APPS 1 Main Memory Background Swapping Contiguous allocation Paging Segmentation Segmentation with paging ECE/IUPUI RTOS & APPS 2 1

2 Background Program must be brought into memory and placed within a process for it to be run. Input queue collection of processes on the disk that are waiting to be brought into memory to run the program. User programs go through several steps before being run. From the memory-unit viewpoint, a CPU generate a stream of memory address. It doesn t matter how they were generated or what they are for. ECE/IUPUI RTOS & APPS 3 Binding of Instructions and Data to Memory Most systems allow a user program to reside in any part of the physical memory. How can a user program know where its data are? Address binding of instructions and data to memory addresses can happen at three different stages Compile time : if memory location known a priori, absolute code can be generated; Must recompile code if starting location changes. Load time: must generate relocatable code if memory location is not known at compile time. Execution time : binding delayed until run time if the process can be moved during its execution from one memory segment to another. Need hardware support for address maps (e.g., Base and limit registers). ECE/IUPUI RTOS & APPS 4 2

3 Multistep Processing of a User Program ECE/IUPUI RTOS & APPS 5 Logical vs. Physical Address Space The concept of a logical address space that is bound to a separate physical address space is central to proper memory management. Logical address generated by the CPU; also referred to as virtual address. Physical address address seen by the memory unit. Logical and physical addresses are the same in compile-time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme. ECE/IUPUI RTOS & APPS 6 3

4 Memory-Management Unit (MMU) Hardware device that maps virtual to physical address. In MMU scheme, the value in the relocation register is added to every address generated by a user process at the time it is sent to memory. The user program deals with logical addresses; it never sees the real physical addresses. ECE/IUPUI RTOS & APPS 7 Dynamic relocation using a relocation register ECE/IUPUI RTOS & APPS 8 4

5 Dynamic Loading Routine is not loaded until it is called Better memory-space utilization; Unused routine is never loaded. All routines are staying on disk in a relocatable load format. The main program is loaded into memory and is executed. When a routine needs to call another routine, the calling routine first check to see whether the other routine has been loaded. If not, the relocatable linking loader is called to load the desired routine into memory and to update the program s address table to reflect this change. Then, control is passed to the newly loaded routine. Useful when large amounts of code are needed to handle infrequently occurring cases. (eg. Error handling routines) No special support from the operating system is required implemented through program design. It is the responsibility of the user to design their program to take advantage of such a method. ECE/IUPUI RTOS & APPS 9 Dynamic Linking Similar to dynamic loading. Linking postponed until execution time. Small piece of code, stub, used to locate the appropriate memory-resident library routine. Stub replaces itself with the address of the routine, and executes the routine. All processes that use a language library execute only one copy of the library code. Operating system needed to check if routine is in processes memory address. Dynamic linking is particularly useful for libraries. A library may be replaced by a new version, and all programs that references the library will automatically use the new version. ECE/IUPUI RTOS & APPS 10 5

6 Overlays To make a process larger than an allocated memory Keep in memory only those instructions and data that are needed at any given time. Implemented by user, no special support needed from operating system, programming design of overlay structure is complex Example) Pass1 70 KB, Pass2 80 KB, Symbol Table 20KB, Common routine 30KB Without overlay, 200KB is required The overlay itself needs some memory space, says 10KB ECE/IUPUI RTOS & APPS 11 Overlays for a Two-Pass Assembler With the overlay, 140KB is enough ECE/IUPUI RTOS & APPS 12 6

7 Swapping (1) A process can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution. Backing store fast disk large enough to accommodate copies of all memory images for all users; must provide direct access to these memory images. ECE/IUPUI RTOS & APPS 13 Swapping (2) Major part of swap time is transfer time; total transfer time is directly proportional to the amount of memory swapped. For example, 1 MB process, 5MB / sec hard-disk, no head seeks, average latency 8 msec. The total swap time is ( swap-out and swap-in) 2 * (1MB / (5 MB/sec) + 8 msec)=416 msec If the system uses Round-robin, the time quantum must be much larger than 416 msec. Modified versions of swapping are found on many systems, i.e., UNIX, Linux, and Windows. ECE/IUPUI RTOS & APPS 14 7

8 Schemes of Memory Allocation Contiguous Allocation Paging Segmentation Segmentation with Paging ECE/IUPUI RTOS & APPS 15 Contiguous Allocation Main memory usually into two partitions: Resident operating system, usually held in low memory User processes then held in high memory. Why an OS in low memory? location of interrupt vector table Single-partition allocation Relocation-register scheme used to protect user processes from each other, and from changing operating-system code and data. Relocation register contains value of smallest physical address; limit register contains range of logical addresses each logical address must be less than the limit register. ECE/IUPUI RTOS & APPS 16 8

9 CA, Hardware Support for Relocation and Limit Registers MMU maps the logical address dynamically by adding the value in the relocation register. Memory Management Unit limit register relocation register logical physical CPU address < yes + address Memory no trap: addressing error ECE/IUPUI RTOS & APPS 17 CA, Memory Allocation OS maintains a table for allocated memory block and available memory block Initially, all memory is available, so there is one large block of available memory, or one big hole Holes of various size are scattered throughout memory. When a process arrives, it is allocated memory from a hole large enough to accommodate it. If a hole is large, it is split into two segments, one for allocating to a new process, the other hole is returned to the pool of holes. When a process terminates, it releases its block which is placed to the pool of holes. ECE/IUPUI RTOS & APPS 18 9

10 CA, Dynamic Storage-Allocation Problem How to satisfy a request from the set of available holes Random-fit: choose an arbitrary hole among those large enough; not good utilization First-fit: Allocate the first hole of the table that is big enough. Time complexity is O(N/2), where N is the number of holes. Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size. Produces the smallest leftover hole. Time complexity is O(N). Worst-fit: Allocate the largest hole; must also search entire list. Produces the largest leftover hole. utilization is worse than FF & BF. Next-fit: Like FF, but start the search at the hole where the last placement was made and treat the list of holes as a circular lis t. Time complexity O(N) utilization = occupied_memory / total_memory ECE/IUPUI RTOS & APPS 19 CA, Knuth Foundings For most placement policies including BF&FF, the number of holes is, on average, approximately equal to one half the number of segments N segments N/2 unusable holes BF & FF had about the same utilization ECE/IUPUI RTOS & APPS 20 10

11 CA, Fragmentation External Fragmentation total memory space exists to satisfy a request, but there is no single hole to hold the request Internal Fragmentation To solve the external fragmentation, the memory is partitioned into a fixed-size block. Then, allocate memory in unit of block size, but not in byte. Allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used. ECE/IUPUI RTOS & APPS 21 CA, Compaction Reduce external fragmentation by compaction Shuffle memory contents to place all free memory together in one large block. Compaction is possible only if relocation is dynamic, and is done at execution time. ECE/IUPUI RTOS & APPS 22 11

12 CA, Binary Buddy Systems, Method The system keeps the lists of holes, one list for each of the size 2 m, 2 m+1,,2 n, where 2 m is the smallest segment size. A request to place a segment of size s Round s upto the next power of 2, ie. 2 k such that 2 k-1 <s 2 k Look in the free list for size 2 k. If not empty, place the segment in the first entry & remove that entry from the list. If there are no holes of size 2 k, look in list for size 2 k+1, etc until a hole is found. Then recursively divide that hole by 2 until the required size is got and use it. If we use a hole of size 2 k+l, we will leave hole of size 2 k+l-1, 2 k+l-2,,2 k ECE/IUPUI RTOS & APPS 23 CA, BDS (example) Assume memory of size 1024, and memory request is rounded to is partitioned into 512, 256, and 2x128 one of size 128 is allocated for the request. If we wished to place a segment of size 600, the buddy system rejects the request, even though the 3 neighboring holes can add upto more than ECE/IUPUI RTOS & APPS 24 12

13 CA, BDS (Recombination) When a segment departs, the system looks to see if its buddy (block of same size with same parent in binary tree) is vacant. If so, the 2 buddies are recombined, and the recombination process continues recursively up the tree until a non-vacant buddy is found. 2 holes cannot be recombined ECE/IUPUI RTOS & APPS 25 CA, Fibonacci System Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, Memory utilization Binary, about 65% Fibonacci, about 60% ECE/IUPUI RTOS & APPS 26 13

14 CA, Weight System Power of 2 splits 2 k = 2 k-2 + 3*2 k-2 New power of 2 such as 3*2 p = 2 p + 2 p+1 The weighted scheme has twice as many available size for a given size range as does the binary scheme New entries are mid way between the binary scheme s entry Average internal fragmentation for segment is about ½ that of the binary schemes ECE/IUPUI RTOS & APPS 27 CA, Fibonacci and Weighted Schemes Both Fibnacci and weighted schemes improve internal fragmentation, but degrade external fragmentation so much that the average utilization is worse than for the binary scheme ECE/IUPUI RTOS & APPS 28 14

15 CA, Dual Buddy Systems Keep 2 separate areas of memory one of size 2 k, operating the binary buddy system the other of size 3*2 p, also operating the binary buddy system Results in all the same size as the weighted schemes, but reduce external fragmentation Overall utilization is better than in the binary buddy system ECE/IUPUI RTOS & APPS 29 CA, Computing Mean Internal Fragmentation Assumption buddy sizes : 8, 16, 32, 64, 128, and segment size: 10, 11,, 100 are all equally likely to arrive P(s=10) = P(s=11) = P(s=100) = 1/91 f(s) = fragmentation for segment size s Mean internal fragmentation = Σ P(s)*f(s) 100 s = 10 P( s) f ( s) = = = s = s = 10 6 i= 0 f ( s) + (16 s) + i + 15 i= 0 32 s= 17 i + f ( s) s = 17 i= 0 (32 s) + i + 63 i= 0 64 s = 33 i f ( s) + f ( s) (64 s) + (128 s) = = 25 ECE/IUPUI RTOS & APPS i= 0 64 s = 33 i 100 s = s = 65 15

16 Paging Allow the physical address space of a process to be noncontiguous Divide physical memory into fixed-sized blocks called frames (size is power of 2. Why?) Divide logical memory into blocks of same size - pages. To run a program of size n pages, need to find n free frames Set up a page table to translate logical to physical addresses. Paging is usually required for virtual memory, which introduces an unexpectable long-term delay. Hence, realtime systems mostly have no virtual memory. However, the technique used in paging is valuable in many system architecture in real-time system. (e.g. IP router, ATM switch) ECE/IUPUI RTOS & APPS 31 Address Translation Scheme Address generated by CPU is divided into: Page number (p) used as an index into a page table which contains the base address of each page in physical memory. Page offset (d) combined with base address to define the physical memory address that is sent to the memory unit. The base address is combined with the page offset to define the physical memory address. ECE/IUPUI RTOS & APPS 32 16

17 Address Translation Architecture ECE/IUPUI RTOS & APPS 33 Paging Example ECE/IUPUI RTOS & APPS 34 17

18 Paging Example page 0 page 1 page 2 page 3 frame 0 frame 1 frame 2 frame 3 frame 4 frame 5 frame 6 frame 7 ECE/IUPUI RTOS & APPS 35 Internal fragmentation Using the paging scheme, no external fragmentation, but Some internal fragmentation. e.g.) Assume the page size is 2KB Assume the size of a memory request is random. What is the average internal fragmentation? Small page size is desirable due to internal fragmentation cause overhead for page table for each process. e.g.) 32-bit address and 4 byte for each entry in page table 2KB page size 11-bit offset 2 21 entries 8 MB page table 8KB page size 13-bit offset 2 19 entries 2 MB page table ECE/IUPUI RTOS & APPS 36 18

19 Free Frames and Allocation Before allocation After allocation ECE/IUPUI RTOS & APPS 37 Implementation of Page Table Page table is stored in main memory due to its size. Page-table base register (PTBR) points to the page table. In this scheme every memory access requires two memory accesses. One for the page table and One for the memory itself. The two memory access problem can be solved by the use of a special fast-lookup hardware cache called associative memory or content address memory (CAM), called translation look-aside buffers (TLBs) ECE/IUPUI RTOS & APPS 38 19

20 TLB Associative memory parallel search Page # (key) Frame # (value) Address translation [A, A ] Operation When A is in associative memory, it is compared with all key (page #) simultaneously. If found, get value (frame #) out. If not found, get frame # from page table in memory and add the page # and frame # to TLB. If TLB is full, OS selects a victim for replacement. Who will be the victim? LRU (Least Recently Used) or Random ECE/IUPUI RTOS & APPS 39 Paging Hardware With TLB ECE/IUPUI RTOS & APPS 40 20

21 TLB, ASID (Address Space ID) to identify who (which process) generate the memory address Several processes can share a TLB On a context switch, OS need not flush all TLB entries ECE/IUPUI RTOS & APPS 41 Effective Access Time Associative Lookup = ε time unit Assume memory cycle time is 1 time unit Hit ratio (r) percentage of times that a page number is found in the associative registers; ration related to number of associative registers. Effective Access Time T effective = (1 + ε) r + (2 + ε)(1 r) = 2 + ε r ECE/IUPUI RTOS & APPS 42 21

22 Memory Protection Memory protection implemented by associating protection bit with each frame. Valid-invalid bit attached to each entry in the page table: valid indicates that the associated page is in the process logical address space, and is thus a legal page. invalid indicates that the page is not in the process logical address space. ECE/IUPUI RTOS & APPS 43 Valid (v) or Invalid (i) Bit In A Page Table ECE/IUPUI RTOS & APPS 44 22

23 Page Table Structure Most modern systems supports a large logical memory address (32-bit to 64-bit) The page table itself become excessively large e.g.) 32-bit system, 4KB page size, 1M page entries. Ass4ume 4- byte per entry, 4 MB for page table only. However, in most case, user programs do not need all logical memory space. 200 KB process, but 4 MB page table for the process!! Solution: Organize the page table. Hierarchical Paging Hashed Page Tables Inverted Page Tables ECE/IUPUI RTOS & APPS 45 Hierarchical Page Tables Break up the logical address space into multiple page tables. A simple technique is a two-level page table. ECE/IUPUI RTOS & APPS 46 23

24 Two-Level Paging Example A logical address (on 32-bit machine with 4K page size) is divided into: a page number consisting of 20 bits. a page offset consisting of 12 bits. Since the page table is paged, the page number is further divided into: a 10-bit page number. a 10-bit page offset. Thus, a logical address is page number as follows: where p i is an index into the outer page table, and p 2 is the displacement within the page of the outer page table. p i p 2 d page offset ECE/IUPUI RTOS & APPS 47 Two-Level Page-Table Scheme ECE/IUPUI RTOS & APPS 48 24

25 Address-Translation Scheme Address-translation scheme for a two-level 32-bit paging architecture ECE/IUPUI RTOS & APPS 49 High Level Page Table Some system supports more than 2-level paging. e.g. SPARC supports 3-level paging 32-bit MC supports 4-level paging ECE/IUPUI RTOS & APPS 50 25

26 Hashed Page Tables 64-bit systems need 7- level paging table in hierarcy structure NO WAY!! Too many memory access for address translation. Hashed page table is for handling address space larger than 32 bits. The virtual page number is hashed into a page table. This page table contains a chain of elements hashing to the same location. Virtual page numbers are compared in this chain searching for a match. If a match is found, the corresponding physical frame is extracted. ECE/IUPUI RTOS & APPS 51 Hashed Page Table ECE/IUPUI RTOS & APPS 52 26

27 Inverted Page Table Each process needs a page table, but all of them are for mapping to a single physical memory e.g.) Assume 100 processes, hence 100 page table. As a whole, all page tables are mapped to a physical memory. Many entries in page tables are just for wasting of memory. Solution: Inverted Page Table One entry for each real page of memory. Hence, map from a physical address to a logical address. Entry consists of the virtual address of the page stored in that real memory location, with information about the process that owns that page. Decreases memory needed to store each page table, but increases time needed to search the table when a page reference occurs. Use hash table to limit the search to one or at most a few page-table entries. ECE/IUPUI RTOS & APPS 53 Inverted Page Table Architecture ECE/IUPUI RTOS & APPS 54 27

28 Shared Pages One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems). The code must be a reentrant code. Shared code must appear in same location in the logical address space of all processes. Similar to the sharing of address space of a task by threads (tasks). Difficult to make shared pages for the systems using inverted page table. because each physical frame has only one virtual page. ECE/IUPUI RTOS & APPS 55 Shared Pages, Example ECE/IUPUI RTOS & APPS 56 28

29 Segmentation Memory-management scheme that supports user view of memory. A program is a collection of segments. A segment is a logical unit such as: main program, procedure, function, method, object, local variables, global variables, common block, stack, symbol table, arrays ECE/IUPUI RTOS & APPS 57 Segmentation Hardware ECE/IUPUI RTOS & APPS 58 29

30 User s View of a Program ECE/IUPUI RTOS & APPS 59 Logical View of Segmentation user space physical memory space ECE/IUPUI RTOS & APPS 60 30

31 Segmentation Architecture Logical address consists of a two tuple: <segment-number, offset>, Segment table maps two-dimensional physical addresses; each table entry has: base contains the starting physical address where the segments reside in memory. limit specifies the length of the segment. Segment-table base register (STBR) points to the segment table s location in memory. Segment-table length register (STLR) indicates number of segments used by a program; A segment number s is legal if s < STLR. ECE/IUPUI RTOS & APPS 61 Example of Segmentation ECE/IUPUI RTOS & APPS 62 31

32 Segmentation Architecture (Cont.) Relocation. dynamic by segment table Sharing. shared segments same segment number Allocation. first fit/best fit external fragmentation ECE/IUPUI RTOS & APPS 63 Segmentation Architecture (Cont.) Protection. With each entry in segment table associate: validation bit = 0 illegal segment read/write/execute privileges Protection bits associated with segments; code sharing occurs at segment level. Since segments vary in length, memory allocation is a dynamic storage-allocation problem. ECE/IUPUI RTOS & APPS 64 32

33 Sharing of Segments ECE/IUPUI RTOS & APPS 65 Segmentation with Paging Combine paging and segmentation Intel 386 uses segmentation with paging for memory management with a two- level paging scheme. ECE/IUPUI RTOS & APPS 66 33

34 Notes Chapter 10 Virtual Memory is very critical in building an OS efficiently. Many performance aspects of OS es are measured by the virtual memory. Even though, this class will not cover this chapter because most of real-time operating systems do not support the virtual memory, because secondary storage is usually not an RTOS or embedded system component. (counterexample, ipod) execution time cannot be expected with the virtual memory But, I strongly recommend you to read the chapter by yourselves. ECE/IUPUI RTOS & APPS 67 34

Chapter 9: Memory Management. Background

Chapter 9: Memory Management. Background 1 Chapter 9: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 9.1 Background Program must be brought into memory and placed within a process for

More information

Part Three - Memory Management. Chapter 8: Memory-Management Strategies

Part Three - Memory Management. Chapter 8: Memory-Management Strategies Part Three - Memory Management Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies 8.1 Background 8.2 Swapping 8.3 Contiguous Memory Allocation 8.4 Segmentation 8.5 Paging 8.6

More information

Memory Management. Memory Management

Memory Management. Memory Management Memory Management Gordon College Stephen Brinton Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 1 Background Program must be brought into memory

More information

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management Part Four - Memory Management 8.1 Background Chapter 8: Memory-Management Management Strategies Program must be brought into memory and placed within a process for it to be run Input queue collection of

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY I.-C. Lin, Assistant Professor. Textbook: Operating System Principles 7ed CHAPTER 8: MEMORY MANAGEMENT Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of

More information

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY MANAGEMENT Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009! Chapter 8: Memory Management Background" Swapping " Contiguous Memory Allocation" Paging" Structure

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 8.2 Silberschatz, Galvin

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Background Program must be brought into memory and placed

More information

Chapter 8: Memory Management Strategies

Chapter 8: Memory Management Strategies Chapter 8: Memory- Management Strategies, Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table

More information

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory

Module 9: Memory Management. Background. Binding of Instructions and Data to Memory Module 9: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 9.1 Background Program must be brought into memory

More information

Module 8: Memory Management

Module 8: Memory Management Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.1 Background Program must be brought into memory

More information

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition Chapter 7: Main Memory Operating System Concepts Essentials 8 th Edition Silberschatz, Galvin and Gagne 2011 Chapter 7: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure

More information

Module 8: Memory Management

Module 8: Memory Management Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts 8.1 Silberschatz and Galvin

More information

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science

Memory Management. CSCI 315 Operating Systems Design Department of Computer Science Memory Management CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture are based on those from Operating Systems Concepts, 9th ed., by Silberschatz, Galvin,

More information

Logical versus Physical Address Space

Logical versus Physical Address Space CHAPTER 8: MEMORY MANAGEMENT Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts, Addison-Wesley 1994

More information

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s Chapter 8: Memory- Management Strategies Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2009/12/16

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation

Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Basic Hardware Address Binding Logical VS Physical Address Space Dynamic Loading Dynamic Linking and Shared

More information

Chapter 8: Memory-Management Strategies

Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 8: MEMORY MANAGEMENT By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

Chapter 8: Memory- Management Strategies

Chapter 8: Memory- Management Strategies Chapter 8: Memory Management Strategies Chapter 8: Memory- Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition Chapter 8: Memory Management 8.1 Silberschatz, Galvin and Gagne 2009 Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and 64-bit Architectures Example:

More information

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Chapter 8: Main Memory. Operating System Concepts 9 th Edition Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES OBJECTIVES Detailed description of various ways of organizing memory hardware Various memory-management techniques, including paging and segmentation To provide

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

Chapter 8 Memory Management

Chapter 8 Memory Management Chapter 8 Memory Management Da-Wei Chang CSIE.NCKU Source: Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, "Operating System Concepts", 9th Edition, Wiley. 1 Outline Background Swapping Contiguous

More information

Memory Management. Contents: Memory Management. How to generate code? Background

Memory Management. Contents: Memory Management. How to generate code? Background TDIU11 Operating systems Contents: Memory Management Memory Management [SGG7/8/9] Chapter 8 Background Relocation Dynamic loading and linking Swapping Contiguous Allocation Paging Segmentation Copyright

More information

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9: Memory Management Background Swapping Contiguous Memory Allocation Segmentation

More information

Background. Contiguous Memory Allocation

Background. Contiguous Memory Allocation Operating System Lecture 8 2017.5.9 Chapter 8 (Main Memory) Background Swapping Contiguous Memory Allocation Segmentation - Paging Memory Management Selection of a memory-management method for a specific

More information

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 1 Background Memory management is crucial in better utilizing one of the most important

More information

Memory Management. Memory

Memory Management. Memory Memory Management These slides are created by Dr. Huang of George Mason University. Students registered in Dr. Huang s courses at GMU can make a single machine readable copy and print a single copy of

More information

Lecture 8 Memory Management Strategies (chapter 8)

Lecture 8 Memory Management Strategies (chapter 8) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 8 Memory Management Strategies (chapter 8) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The

More information

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time

Memory Management Cache Base and Limit Registers base limit Binding of Instructions and Data to Memory Compile time absolute code Load time Memory Management To provide a detailed description of various ways of organizing memory hardware To discuss various memory-management techniques, including paging and segmentation To provide a detailed

More information

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit Memory Management All data in memory before and after processing All instructions in memory in order to execute Memory management determines what is to be in memory Memory management activities Keeping

More information

SHANDONG UNIVERSITY 1

SHANDONG UNIVERSITY 1 Chapter 8 Main Memory SHANDONG UNIVERSITY 1 Contents Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium SHANDONG UNIVERSITY 2 Objectives

More information

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University Main Memory CISC3595, Spring 2015 X. Zhang Fordham University 1 Memory Management! Background!! Contiguous Memory Allocation!! Paging!! Structure of the Page Table!! Segmentation!! Example: The Intel Pentium

More information

Goals of Memory Management

Goals of Memory Management Memory Management Goals of Memory Management Allocate available memory efficiently to multiple processes Main functions Allocate memory to processes when needed Keep track of what memory is used and what

More information

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 Acknowledgement: This set of slides is partly based on the PPTs provided by the Wiley s companion website (including textbook images, when not explicitly

More information

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure. File Systems I/O Management Hard Drive Management Virtual Memory Swap Memory Management Storage and I/O Introduction CSI3131 Topics Process Management Computing Systems Memory CPU Peripherals Processes

More information

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University

Roadmap. Tevfik Koşar. CSC Operating Systems Spring Lecture - XII Main Memory - II. Louisiana State University CSC 4103 - Operating Systems Spring 2007 Lecture - XII Main Memory - II Tevfik Koşar Louisiana State University March 8 th, 2007 1 Roadmap Dynamic Loading & Linking Contiguous Memory Allocation Fragmentation

More information

CS307 Operating Systems Main Memory

CS307 Operating Systems Main Memory CS307 Main Memory Fan Wu Department of Computer Science and Engineering Shanghai Jiao Tong University Spring 2018 Background Program must be brought (from disk) into memory and placed within a process

More information

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University

Main Memory Yi Shi Fall 2017 Xi an Jiaotong University Main Memory Yi Shi Fall 2017 Xi an Jiaotong University Goals Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Background Program must be brought (from disk)

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L17 Main Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Was Great Dijkstra a magician?

More information

CS 3733 Operating Systems:

CS 3733 Operating Systems: CS 3733 Operating Systems: Topics: Memory Management (SGG, Chapter 08) Instructor: Dr Dakai Zhu Department of Computer Science @ UTSA 1 Reminders Assignment 2: extended to Monday (March 5th) midnight:

More information

CS420: Operating Systems

CS420: Operating Systems Main Memory James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Background Program must

More information

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Chapter 8 & Chapter 9 Main Memory & Virtual Memory Chapter 8 & Chapter 9 Main Memory & Virtual Memory 1. Various ways of organizing memory hardware. 2. Memory-management techniques: 1. Paging 2. Segmentation. Introduction Memory consists of a large array

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

Main Memory (Part I)

Main Memory (Part I) Main Memory (Part I) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Main Memory 1393/8/5 1 / 47 Motivation and Background Amir

More information

Principles of Operating Systems

Principles of Operating Systems Principles of Operating Systems Lecture 18-20 - Main Memory Ardalan Amiri Sani (ardalan@uci.edu) [lecture slides contains some content adapted from previous slides by Prof. Nalini Venkatasubramanian, and

More information

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72

P r a t t hr h ee e : e M e M m e o m r o y y M a M n a a n g a e g m e e m n e t 8.1/72 Part three: Memory Management programs, together with the data they access, must be in main memory (at least partially) during execution. the computer keeps several processes in memory. Many memory-management

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Silberschatz, Galvin and Gagne 2005 Background Program/Code

More information

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01

Unit-03 Deadlock and Memory Management Unit-03/Lecture-01 1 Unit-03 Deadlock and Memory Management Unit-03/Lecture-01 The Deadlock Problem 1. A set of blocked processes each holding a resource and waiting to acquire a resource held by another process in the set.

More information

Chapters 9 & 10: Memory Management and Virtual Memory

Chapters 9 & 10: Memory Management and Virtual Memory Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection

More information

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems Instructor: Dr. Turgay Korkmaz Department Computer Science The University of Texas at San Antonio Office: NPB

More information

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University.

Memory Management. Minsoo Ryu. Real-Time Computing and Communications Lab. Hanyang University. Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered Introduction Memory Allocation and Fragmentation Address Translation Paging

More information

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University

Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University Memory Management Minsoo Ryu Real-Time Computing and Communications Lab. Hanyang University msryu@hanyang.ac.kr Topics Covered Introduction Memory Allocation and Fragmentation Address Translation Paging

More information

Chapter 9 Memory Management

Chapter 9 Memory Management Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is super big to hold a program

More information

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science Virtual Memory CSCI 315 Operating Systems Design Department of Computer Science Notice: The slides for this lecture have been largely based on those from an earlier edition of the course text Operating

More information

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

CS6401- Operating System UNIT-III STORAGE MANAGEMENT UNIT-III STORAGE MANAGEMENT Memory Management: Background In general, to rum a program, it must be brought into memory. Input queue collection of processes on the disk that are waiting to be brought into

More information

Chapter 8 Main Memory

Chapter 8 Main Memory COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 8 Main Memory Zhi Wang Florida State University Contents Background Swapping Contiguous memory allocation Paging Segmentation OS examples

More information

Chapter 8: Memory- Management Strategies Dr. Varin Chouvatut

Chapter 8: Memory- Management Strategies Dr. Varin Chouvatut Part I: Overview Part II: Process Management Part III : Storage Management Chapter 8: Memory- Management Strategies Dr. Varin Chouvatut, Silberschatz, Galvin and Gagne 2010 Chapter 8: Memory Management

More information

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358 Memory Management Reading: Silberschatz chapter 9 Reading: Stallings chapter 7 1 Outline Background Issues in Memory Management Logical Vs Physical address, MMU Dynamic Loading Memory Partitioning Placement

More information

CSE 421/521 - Operating Systems Fall Lecture - XII Main Memory Management. Tevfik Koşar. University at Buffalo. October 18 th, 2012.

CSE 421/521 - Operating Systems Fall Lecture - XII Main Memory Management. Tevfik Koşar. University at Buffalo. October 18 th, 2012. CSE 421/521 - Operating Systems Fall 2012 Lecture - XII Main Memory Management Tevfik Koşar University at Buffalo October 18 th, 2012 1 Roadmap Main Memory Management Fixed and Dynamic Memory Allocation

More information

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses. 1 Memory Management Address Binding The normal procedures is to select one of the processes in the input queue and to load that process into memory. As the process executed, it accesses instructions and

More information

Chapter 8: Main Memory. Operating System Concepts 8th Edition

Chapter 8: Main Memory. Operating System Concepts 8th Edition Chapter 8: Main Memory Operating System Concepts 8th Edition Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page

More information

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program

More information

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS SPRING 2013 Lecture 13: Paging Prof. Alan Mislove (amislove@ccs.neu.edu) Paging Physical address space of a process can be noncontiguous; process is allocated physical memory

More information

Memory Management and Protection

Memory Management and Protection Part IV Memory Management and Protection Sadeghi, Cubaleska RUB 2008-09 Course Operating System Security Memory Management and Protection Main Memory Virtual Memory Roadmap of Chapter 4 Main Memory Background

More information

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it to be run Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester Mono-programming

More information

Basic Memory Management

Basic Memory Management Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is infinite Allocation of memory

More information

UNIT-III VIRTUAL MEMORY

UNIT-III VIRTUAL MEMORY MEMORY MANAGEMENT: The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be at least partially in main memory during execution. To improve

More information

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium Main Memory Outlook Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2 Backgound Background So far we considered how to share

More information

The Memory Management Unit. Operating Systems. Autumn CS4023

The Memory Management Unit. Operating Systems. Autumn CS4023 Operating Systems Autumn 2017-2018 Outline The Memory Management Unit 1 The Memory Management Unit Logical vs. Physical Address Space The concept of a logical address space that is bound to a separate

More information

9.1 Background. In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of

9.1 Background. In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of Chapter 9 MEMORY MANAGEMENT In Chapter 6, we showed how the CPU can be shared by a set of processes. As a result of CPU scheduling, we can improve both the utilization of the CPU and the speed of the computer's

More information

CSE 4/521 Introduction to Operating Systems. Lecture 12 Main Memory I (Background, Swapping) Summer 2018

CSE 4/521 Introduction to Operating Systems. Lecture 12 Main Memory I (Background, Swapping) Summer 2018 CSE 4/521 Introduction to Operating Systems Lecture 12 Main Memory I (Background, Swapping) Summer 2018 Overview Objective: 1. To provide a detailed description of various ways of organizing memory hardware.

More information

Process. One or more threads of execution Resources required for execution

Process. One or more threads of execution Resources required for execution Memory Management 1 Learning Outcomes Appreciate the need for memory management in operating systems, understand the limits of fixed memory allocation schemes. Understand fragmentation in dynamic memory

More information

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France Operating Systems Memory Management Mathieu Delalandre University of Tours, Tours city, France mathieu.delalandre@univ-tours.fr 1 Operating Systems Memory Management 1. Introduction 2. Contiguous memory

More information

Main Memory (Part II)

Main Memory (Part II) Main Memory (Part II) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Main Memory 1393/8/17 1 / 50 Reminder Amir H. Payberah

More information

Page Table Structure. Hierarchical Paging. Hashed Page Tables. Inverted Page Tables

Page Table Structure. Hierarchical Paging. Hashed Page Tables. Inverted Page Tables Page Table Structure Hierarchical Paging Hashed Page Tables Inverted Page Tables 1 Hierarchical Page Tables Problem: for very large logical address spaces (2 32 and 2 64 ) the page table itself becomes

More information

Process. One or more threads of execution Resources required for execution. Memory (RAM) Others

Process. One or more threads of execution Resources required for execution. Memory (RAM) Others Memory Management 1 Learning Outcomes Appreciate the need for memory management in operating systems, understand the limits of fixed memory allocation schemes. Understand fragmentation in dynamic memory

More information

Operating System 1 (ECS-501)

Operating System 1 (ECS-501) Operating System 1 (ECS-501) Unit- IV Memory Management 1.1 Bare Machine: 1.1.1 Introduction: It has the ability to recover the operating system of a machine to the identical state it was at a given point

More information

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory Multi-Process Systems: Memory (2) What we will learn A detailed description of various ways of organizing memory Discuss various memory-management techniques, including paging and segmentation To provide

More information

Memory management: outline

Memory management: outline Memory management: outline Concepts Swapping Paging o Multi-level paging o TLB & inverted page tables 1 Memory size/requirements are growing 1951: the UNIVAC computer: 1000 72-bit words! 1971: the Cray

More information

Memory management: outline

Memory management: outline Memory management: outline Concepts Swapping Paging o Multi-level paging o TLB & inverted page tables 1 Memory size/requirements are growing 1951: the UNIVAC computer: 1000 72-bit words! 1971: the Cray

More information

Process. Memory Management

Process. Memory Management Process Memory Management One or more threads of execution Resources required for execution Memory (RAM) Program code ( text ) Data (initialised, uninitialised, stack) Buffers held in the kernel on behalf

More information

Process. One or more threads of execution Resources required for execution. Memory (RAM) Others

Process. One or more threads of execution Resources required for execution. Memory (RAM) Others Memory Management 1 Process One or more threads of execution Resources required for execution Memory (RAM) Program code ( text ) Data (initialised, uninitialised, stack) Buffers held in the kernel on behalf

More information

Operating Systems Unit 6. Memory Management

Operating Systems Unit 6. Memory Management Unit 6 Memory Management Structure 6.1 Introduction Objectives 6.2 Logical versus Physical Address Space 6.3 Swapping 6.4 Contiguous Allocation Single partition Allocation Multiple Partition Allocation

More information

VII. Memory Management

VII. Memory Management VII. Memory Management 1 Intended Schedule Date Lecture Hand out Submission 0 20.04. Introduction to Operating Systems Course registration 1 27.04. Systems Programming using C (File Subsystem) 1. Assignment

More information

Memory and multiprogramming

Memory and multiprogramming Memory and multiprogramming COMP342 27 Week 5 Dr Len Hamey Reading TW: Tanenbaum and Woodhull, Operating Systems, Third Edition, chapter 4. References (computer architecture): HP: Hennessy and Patterson

More information

12: Memory Management

12: Memory Management 12: Memory Management Mark Handley Address Binding Program goes through multiple steps from compilation to execution. At some stage, addresses in the program must be bound to physical memory addresses:

More information

Operating Systems. Memory Management. Lecture 9 Michael O Boyle

Operating Systems. Memory Management. Lecture 9 Michael O Boyle Operating Systems Memory Management Lecture 9 Michael O Boyle 1 Memory Management Background Logical/Virtual Address Space vs Physical Address Space Swapping Contiguous Memory Allocation Segmentation Goals

More information

Main Memory (II) Operating Systems. Autumn CS4023

Main Memory (II) Operating Systems. Autumn CS4023 Operating Systems Autumn 2017-2018 Outline 1 Main Memory (II) Outline Main Memory (II) 1 Main Memory (II) Paging Main Memory (II) Physical address space of a process can be noncontiguous; process is allocated

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 20 Main Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Pages Pages and frames Page

More information