COMP 322: Chapter 6: Memory Management Flashcards

Learn Chapter 6 Memory management

1
Q

Physical memory (RAM)

A

It is 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

A word

A

A fixed-size unit of data.

Can be 1, 2 or 4 bytes

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

Physical address

A

An integer of range [0; n-1] that identifies a word in a physical memory of size n.

The address comprises a fixed number of bits.

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.

Consists 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 range [0; n-1] that identifies a word in a logical address space.

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

The word size of an address space depends on ___

A

Neither the address size nor the address space size.

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

Program transformations: Source module

A

It is a program/program component written in a symbolic language such as C or assembly

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

Program transformations: Object module

A

It is the machine language output of the compiler.

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

Program transformations: Load module

A

is a program or a 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
10
Q

Program relocation

A

The act of moving a program component from one address space to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
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
12
Q

Dynamic relocation

A

Postpones the binding of a logical address to 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
13
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
14
Q

Free space management: 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
15
Q

Free space management: Next-fit

A

Starts each search at the point of last allocation.

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

Free space management: Best-fit

A

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

17
Q

Free space management: Worst-fit

A

Takes the opposite approach from best-fit and chooses the largest available hole for any request.

18
Q

External memory fragmentation

A

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

19
Q

The 50% rule

A

If the probability of finding an exact match for a request, one third of all memory partitions to holes.

20
Q

Swapping

A

The temporarily removal of a module from memory.

The module is saved on a disk and later moved back to memory.

21
Q

Memory compaction

A

The systematic shifting of modules in memory, generally in one direction.

22
Q

Linking

A

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

23
Q

Sharing

A

is the act of linking the same copy of a module to multiple other modules.

It improves memory utilization by making processes share common routines or services.

Its possible under both static and dynamic linking.

24
Q

A page

A

A fixed-size contagious block of a logical address space identified by a single number. The page number.

25
Q

A page frame

A

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

It is also the smallest unit of data for memory management.

26
Q

A page table

A

It is 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 number or the starting address of the frame containing the page.

27
Q

The size of the address space

A

2^(n)

28
Q

The size of the page size

A

2^(k)

29
Q

Components of logical address

A

It has two components:
a page number (p)
an offset w (w) within the page.

It has the form (p,w)

30
Q

Components of a physical address

A

It has two components:
A frame number (f)
an offset w (w) within the frame.

It has the form (f,w)

31
Q

Internal fragmentation

A

The loss of usable memory space due to the mismatch between the page size and the size of the program.

Creates a hole at the end of the program’s last page.

32
Q

Segment

A

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

33
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.

34
Q

Main advantage of segmentation

A

The ability to create multiple variable-size address spaces.

35
Q

Main advantage of paging

A

The ability to place any page into any frame in memory.

Segmentation can be combined with paging.

36
Q

Segmentation with paging (structure)

A

A logical address is divided into 3 components:
a segment number (s)
a page number (p)
an offset (w) within the page.

A physical address is divided into 2 components:
a frame number (f)
an offset (w) within the frame

The OS translates logical addresses of the form (s,p,w) into the corresponding physical addresses (f,w).

37
Q

Translation lookaside buffer (TLB)

A

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

38
Q

Principle of locality

A

states that locations accessed recently are more likely to be accessed again then other locations accessed in the distant past.

39
Q

TBL”s hit ratio

A

The fraction of memory accesses that find a match in the TLB.