Chapter 6: Memory Management Flashcards

1
Q

Physical Memory (RAM)

A

A hardware structure, consisting of a linear sequence of words that hold a program during execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Word

A

A fixed-size unit of data (typically 4 bytes, but can be other sizes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

physical address

A

is an integer in the range [0 : n-1] that identifies a word in a physical memory of size n. The address comprises a fixed number of bits. A memory of size n requires an address size of k bits, where n = 2^k.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

logical address space

A

an abstraction of physical memory, consisting of a sequence of imaginary memory locations in a range [0:m-1], where m is the size of the logical address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

logical address

A

an integer in the range [0:m-1] that identifies a word in a logical address space. Prior to execution, a logical address space is mapped to a portion of physical memory and the program is copied into the corresponding locations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

source module

A

A program or a program component written in a symbolic language, like C, or an assembly language, that must be translated by a compiler into executable machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

object module

A

The machine-language output of a compiler or assembler generated from a source module. An object module may be self-contained and executable or multiple object modules may be linked together into a load module by a linker or linkage editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

load module

A

a program or combination of programs in a form ready to be loaded into main memory and executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Program relocation

A

the act of moving a program component from one address space to another. The relocation may be between two logical address spaces or from a logical address space to a physical address space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Static relocation

A

binds all logical addresses to physical addresses prior to execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Dynamic relocation

A

postpones the binding of a logical address to a physical address until the addressed item is accessed during execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

relocation register

A

contains the physical starting address of a program or program component in memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

First-fit

A

always starts the search from the beginning of the list and allocates the first hole large enough to accommodate the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Next-fit

A

starts each search at the point of the last allocation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Best-fit

A

searches the entire list and chooses the smallest hole large enough to accommodate the request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

worst-fit

A

takes the opposite approach from best-fit by always choosing the largest available hole for any request

17
Q

external memory fragmentation

A

the loss of usable memory space due to holes between allocated blocks of variable sizes

18
Q

50% rule

A

if the probability of finding an exact match for a request approaches 0, one-third of all memory partitions are holes, and two-thirds are occupied by blocks. n = .5m where n is the number of holes and m is the number of occupied blocks.

19
Q

swapping

A

the temporary removal of a module from memory. The module is saved on disk and later moved back to memory. Dynamic relocation is necessary so that the module can be placed into a different location without modification.

20
Q

memory compaction

A

the systematic shifting of modules in memory, generally in one direction, to consolidate multiple disjoint holes into one larger hole.

21
Q

linking

A

The act of resolving external references among object modules and can be done statically, before loading, or dynamically, while the program is already executing.

22
Q

sharing

A

the act of linking the same copy of a module to multiple other modules. Sharing improves memory utilization by allowing multiple processes to share common routines or services (Ex: compilers, editors, word processors), or common data (Ex: dictionaries). Sharing is possible under both static and dynamic linking.

23
Q

page

A

A fixed-size contiguous block of logical address space identified by a single number, the page number.

24
Q

page frame

A

a fixed-size contiguous block of physical memory identified by a single number, the page frame number.

A page frame is the smallest unit of data for memory management and may contain a copy of any page.

25
Q

page table

A

an array that keeps track of which pages of a given logical address space reside in which page frames. each page table entry corresponds to one page and contains the starting address of the frame containing the page

26
Q

Address Translation Algo

A
  1. Given a logical address (p, w), access the page table entry corresponding to page p.
  2. Read the frame number, f, of the frame containing p.
  3. Combine f with the offset w to find the physical address (f, w) corresponding to the logical address (p, w).
27
Q

Internal Fragmentation

A

The loss of usable memory space due to the mismatch between the page size and the size of a program, which creates a hole at the end of the program’s lat page.

28
Q

segment

A

a variable-size block of logical address space identified by a single number, the segment number.

With pure segmentation (no paging), a segment occupies a contiguous area of physical memory and is the smallest unit of data for memory management.

29
Q

segment table

A

An array that keeps track of which segment resides in which area of physical memory. Each entry corresponds to one segment and contains the starting address of the segment.

30
Q

address translation (logical -> physical)

A
  1. Given a logical address (s, w), access the segment table entry at offset s and get the segment’s starting address, sa, and size, sze.
  2. If w ≥ sze then reject the address as illegal.
  3. Otherwise, add w to sa to form the physical address, sa + w, corresponding to the logical address (s, w).
  4. Given a logical address (s, p, w), access the segment table at offset s to find the page table and the size, sze, of segment s.
  5. If (p, w) ≥ sze then reject the address as illegal. Otherwise, access the page table at offset p and read the frame number, f, of the frame containing page p.
  6. Combine f with the offset w to form the physical address, (f, w).
31
Q

transition lookaside buffer (TLB)

A

A fast associate memory buffer that maintains recent translations of logical addresses to frames in physical memory for faster retrieval.

32
Q

principle of locality

A

locations accessed recently are more likely to be accessed again than locations accessed in the distant past.

33
Q

hit ratio

A

The fraction of memory accesses that find a match in the TLB. The higher the TLB hit ratio, the lower the overhead of address translation.