(9) Memory Management Flashcards

1
Q

What are the goals and tools of memory management

A
  • Allocate memory resources among competing processes
  • Provide isolation between processes
  • Convenient abstraction for programmers
  • Provide tools
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do base and limit registers do?

A

A pair of base and limit registers define the logical address space.
CPU must check between every memory access generated in user mode to be sure it is between the base and limit for that user.

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

What are logical/virtual addresses?

A

They make it easier to manage memory of multiple processes. They are independent of location in physical memory. The OS determines the location in physical memory. CPU instructions reference virtual address. These are then translated by hardware into physical addresses.

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

What is the address space of a process?

A

The set of virtual addresses a process can reference.

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

What is an MMU?

A

A memory-management unit. At run time it maps virtual to physical addresses.

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

What is the main benefit to swapping?

A

Total physical memory space of processes can exceed physical memory

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

Describe Backing Store swapping

A

Large enough to accommodate copies of all memory images for all users.
Must provide direct access to these memory images.

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

Describe Roll out, Roll in swapping

A

Used for priority-based scheduling algorithms.

Lower-priority process is swapped out so higher priority process can be loaded and executed.

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

Does the swapped out process need to swap back in to the same physical addresses?

A

Depends on address binding method

-MMU prevents the need for this

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

How can you reduce the cost of swapping?

A

Can reduce the size of memory swapped by knowing how much memory is really being used
Syscalls to inform OS of memory use via request_memory() and release_memory()

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

What id double buffering?

A

Always transfering I/O to kernel space the to I/O device. It adds overhead.

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

What are relocation registers?

A
  • Used to protect user processes from each other, and from changing operating-system code and data
  • Base limit register contains value of smallest physical address
  • Limit register contains range of logical addresses and each logical address must be less than the limit register
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe fixed partition allocation

A

Physical memory is broken into fixed partitions
Requires base register and limit register
+Simple
-Internal fragmentation: the available partition is larger than what was requested for process.

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

Describe variable partition allocation

A

Physical memory broken into partitions dynamically - partitions tailored to programs.
-Requires base register and limit register
+No internal fragmentation as we allocated just enough
-External fragmentation, as we load and unload holes are left scattered throughout physical emmory

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

What is a hole?

A

A block of available memory. Holes of various sizes are scattered throughout memory

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

What is the dynamic storage allocation problem and how is it solved?

A

How do we satisfy a request of size n from a list of free holes?

First-fit = allocate the first hole that is big enough

best-fit = allocate the smallest hole that is big enough but must search entire list

Worst fit = allocate the largest hole (?)

17
Q

Describe internal and external fragmentation and what first fit analysis reveals?

A

Internal = allocated memory may be slightly larger than requested

external = total memory space exists to satisfy a request but is not contiguous.

It reveals that given N blocks allocated 0.5N blocks are lost to fragmentation.
1/3 may be unusable giving 50% rule.

18
Q

What is a segment?

A

A natural unit of sharing - a subroutine or function

19
Q

What is a segment table?

A
  • Multiple base/limit pairs, one per segment
  • Segments named by segment #, used as index into table
  • Offset of virtual address to base address of segment to yield physical address.