ISY 201 - Chapter 3: Memory Management, Virtual Memory Systems

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

First-in First-out (FIFO) policy (71)

A page replacement policy that removes from main memory that pages were brought in first.

Thrashing

A phenomenon in a virtual memory system where an excessive amount of page swapping back and forth between main memory and secondary storage results in higher overhead and little useful work.

The Heap

A region of the computer's memory that is not managed automatically, and is not as tightly managed by the CPU. -A more free-floating region of memory (and is larger). To allocate memory on the heap, you must use malloc() or calloc(), which are built-in C functions.

Cache Memory

A small, fast memory used to hold selected data and to provide faster access than would otherwise be possible.

Stack

A special region the computer's memory that stores temporary variables created by each function (including the main() function). -A "LIFO" (last in, first out) data structure, that is managed and optimized by the CPU quite closely. -Every time a function declares a new variable, it is "pushed" onto the stack. Then every time a function exits, all of the variables pushed onto the stack by that function, are freed (that is to say, they are deleted). - when a function exits, all of its variables are popped off of the stack (and hence lost forever).

Memory Map Table (MMT) (62)

A table in main memory that contains an entry for each page from that contains the location and free/busy status for each one.

Job Table (JT) (61)

A table in main memory that contains two values for each active job - the size of the job and the memory that show the least amount of recent activity.

Virtual Memory (87)

A technique that allows programs to be executed even though they are not stored entirely in memory. -became possible with the ability to move pages at will b/w main memory and secondary storage, removing restrictions on program size. -gives the users the appearance that their programs are completely loaded into main memory during their entire processing time -Shared programs (b/w users) and subroutines are loaded on demand, satisfactorily reducing the storage requirements of main memory -works well in a multiprogramming env. because most programs spend a lot of time waiting (88) -aids in the development of large software systems, because individual pieces can be developed independently and linked later on

1. Reloaded 2. Page Faults

*(Related to working set)* Every time a job is r_______ back into memory, it has to generate several p_____ f_____ until its working set is back in memory and processing can continue. It's a time consuming task for the CPU.

Page Map Table Values

*(The Mechanics of Paging)* 1. Page Number 2. Status Bit 3. Modified Bit 4. Referenced Bit 5. Page Frame No.

Page in Memory

*(The Mechanics of Paging)* Before the memory manager can determine which pages will be swapped out, it needs specific information about each p____ in m_____

1. Modified, status 2. LRU

*(The Mechanics of Paging)* The FIFO algorithm uses only the m_______ and s____ bits when swapping pages but ____ looks at all three before deciding which pages to swap out.

Referenced

*(The Mechanics of Paging, LRU)* The r______ bit indicates whether the page has been called recently.

Stack Pros & Cons

-Very fast access -Don't have to explicitly de-allocate variables -space is managed by CPU, memory will not become fragmented -local variables only -limit on stack size (OS Dependent) -Variables cannot be resized

Heap Pros & Cons

-variables can be accessed globally -no limit on memory size -(relatively) slower access -no guaranteed efficient use of space, memory may become fragmented over time as blocks of memory are allocated, then freed -you must manage memory (you're in charge of allocating and freeing variables) -variables can be resized using realloc()

Page Fault

A type of hardware interrupt caused by a reference to a page not residing in memory the effect is to move a page out of main memory and into secondary storage so another page can be moved into memory.

Segment

A variable-size section of a user's job that contains a logical grouping of code.

The meaning of the bits used in Page Map Table (77)

Status Bit: 0 = Not in Memory, 1 = Resides in Memory Modified Bit: 0 = not modified, 1 = Was modified Referenced Bit: 0 = Not called, 1 = was called

Address Resolution

The Process of changing the address of an instruction or data item to the address in main memory at which is to be loaded or relocated -Every time an instruction is executed, or data value is used, the operating system and/or hardware must translate the job space address (logical), into its physical address (absolute).

Associative Memory (85-86)

The name given to several registers, allocated to each active process, whose contents associate several of the process segments and page numbers with their main memory addresses. -When a job is allocated to the CPU, its SMT is loaded into Main memory, while its PMT are loaded only as they are needed. -When pages are swapped b/w main memory and secondary storage, all tables are updated. -When a page request is issued, two searches (one through segment and PMTs and on through associative registers) whichever one produces results first, the other is abandoned and address translation begns -advantage of large associative memory is increased speed -disadvantage: high cost of the complex hardware required to perform the parallel searches

Belady Anomaly (FIFO Anomaly) (74)

Under certain circumstances, adding more memory can, in rare cases, actually cause an increase in page interrupts when using a FIFO policy. The first known incident of this was discovered by Laszlo Belady

Sector

a division in a magnetic disk's track, sometimes called a "block." The tracks are divided into sectors during the formatting process.

Page

a fixed-size section of a user's job that corresponds in size to a page frames in main memory. -Physical unit that are invisible to the user's program and consist of fixed sizes.

Paged Memory Allocation (60)

a memory allocation scheme base don the concept of dividing a user's job into sections of equal size (called *pages*) to allow for non-contiguous program storage during execution.

Segmented Memory Allocation (81)

a memory allocation scheme based on the concept of dividing a user's job into logical groupings of code to allow for non-contiguous program storage during execution. -Main memory is no longer divided into page frame, because the size of each segment is different ranging from small to large. -Instructions are ordered sequentially but segments do not need to be stored contiguously. The contents of the segments, however, are. -2D address scheme: SEGMENT NUMBER and DISPLACEMENT -Causes external fragmentation, thereby needs re-compaction software.

Demand Paging (66)

a memory allocation scheme that loads a program's page into memory at the time it is needed for processing. -jobs are still divided into equally sized pages that initially reside in secondary storage -key to success with this scheme is the use of high speed direct access storage device DASD)

Page Map Table (PMT) (62)

a table in main memory with the vital information for each page including the page number and its corresponding page frame memory address.

Segment Map Table (SMT)

a table in main memory with the vital information for each segment including segment number and its corresponding memory address.

Clock Page Replacement Policy (74)

a variation of the LRU policy that removes from main memory the pages that show the least amount of activity during recent clock cycles.

Displacement (62)

in a paged or segmented memory allocation environment, the different between a page's relative address and the actual machine language address. Also called offset.

Segmented/Demand Page Memory Allocation (84)

memory allocation scheme based on the concept of dividing a user's job into logical groupings of code and loading them into memory as needed to minimize fragmentations. -Offers logical benefits of segmentation and physical benefits of paging. -Subdivides segments into pages of equal size that are smaller than most segments and more easily manipulated than whole segments -Many of the problems of segmentation (compactioon, external frag, and Secondary Storage handling) are removed because of the page's fixed length -3D Scheme: SEGMENT_NUMBER, PAGE_NUMBER, and DISPLACEMENT -High overhead, and the time required to reference the tables is high.

Advantages/Disadvantages of Virtual Memory

A: -A job's size is no longer restricted to the size of main memory (or free space available within main memory) -Memory is used more efficiently because the only sections of a job store din memory are those needed immediately, while those not needed remain in secondary storage -It allows an unlimited amount of multiprogramming, which can apply to many jobs, as in dynamic and static partitioning, or to many users. -It allows the sharing of code and data -It facilitates dynamic linking of programming segments D: -Increased processor hardware costs -Increased overhead for handling page interrupts -Increased software complexity to prevent thrashing

Least Recently Used (LRU) Policy (73)

Behavior observed in many executing programs in which memory locations recently referenced, and those near the, are likely to be referenced in the near future.

Locality of Reference (79)

Behavior observed in many executing programs in which memory locations recently referenced, and those near them, are likely to be referenced in the near future. -using only a small fraction of its pages

Reentrant Code (88)

code that can be used by two or more processes at the same time; each share the same copy of the executable code but has separate data areas.

Clock Cycle (74)

the elapsed time between two ticks of the computer's system clock.

Page Fault Handler (69)

the part of the Memory Manager that determines if there are empty page frames in memory so that the requetsed page can be immediately copied from secondary storage, or determines which page must be swapped out if all page frames are busy. Also known as *page interrupt handler*.

Page Swapping

the process of moving a page out of main memory and into secondary storage so another page can be moved into memory in its place.

Advantages and Disadvantages of Demand Paging

1. Job's no longer constrained by the size of physical memory (introducing virtual memory) 2. utilized memory more efficiently than the previous scheme because the sections of a job that were used seldom or not at all. vs. 1. Increased overhead cause by tables and page interrupts

Working Set (78)

A collection of pages to be kept in main memory for each active process in a virtual memory environment. -can be accessed directly without incurring a page fault -Typically a jobs working set changes as the job moves through the system.

Subroutine

Also called a subprogram, a segment of a program that can perform a specific function. Subroutines can reduce programming time when a specific function is required at more than one point in a program.

Page Replacement Policy (71)

An algorithm used by virtual memory systems to decide which page or segment to remove from main memory when a page frame is needed and memory is full.

Page Frame

An individual section of main memory of uniform size into which a single page may be loaded without causing external fragmentation.

FIFO Anomaly

An unusual circumstance through which adding more page frames causes an increase in page interrupts when using a FIFO page replacement policy.

Bit Shifting Variation

See Page 75-76 on information regarding bitshifting


संबंधित स्टडी सेट्स

Nursing 120 CH 29 Medications ML4

View Set

0511 An Advanced Review of Speech-Language Pathology, 5th Edition: Practice Examinations Question of the Day Study Set

View Set

Chapter 15 (Anus, Rectum and Prostate)

View Set

Cost Accounting 3331 Exam 3 Chapters 9, 10, and 11

View Set

Final Exam Anatomy Primary dentition, TMJ, and Occlusion

View Set

Subatomic particles and the atom

View Set