P3L2 - Memory Management Flashcards

1
Q

How does the OS decouple physical memory from memory that a process interacts with?

A

By providing a address space

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

T/F: The range of virtual addresses that are visible to a process can be much larger than the actual amount of physical memory?

A

True

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

What is allocation?

A

Requires that the OS incorporate certain mechanisms and data structures so it can track how memory is used and what memory is free?

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

What is arbitration?

A

Requires that the OS can quickly interpret and verity a process memory access and to translate a virtual address into a physical address and validate it to verify that it is a legal access

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

____ are fixed-size segments that the virtual address space is divided into

A

Pages

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

____ are the segments that the physical memory is divided into?

A

Page Frames

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

How does the operating system map pages into page frames?

A

Via page tables

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

T/F: Paging is not the only way to decouple the virtual and physical memories?

A

True - Another approach is segmentation, or a segment-based memory approach

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

______ is the dominant memory management mechanism

A

Paging

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

T/F: Memory management is not done by the OS alone?

A

True! Hardware mechanisms help

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

What unit is responsible for converting virtual into physical addresses?

A

The MMU (Memory Management Unit)

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

____ is a small cache of virtual-physical address translations

A

TLB (Translation Lookaside Buffer)

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

What is the use of page tables?

A

To convert the virtual memory addresses into physical memory addresses

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

T/F: For each virtual address, an entry in the page table is used to determine the actual physical address?

A

True!

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

T/F: The sizes of the pages in virtual memory are identical to the sizes of the page frames in physical memory?

A

True

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

When dealing with a single level page table, what is the first portion of the virtual address known as?

A

The Virtual Page Number (VPN)

17
Q

When dealing with a single level page table, what is the last portion of the virtual address known as?

A

The Offset

18
Q

What is produced by using the VPN in paging?

A

The Physical Frame Number - First physical address of the frame in DRAM

19
Q

Given the physical frame number how is translation completed when dealing with a single level page table?

A

By using the offset to index into the physical frame to find the appropriate address

20
Q

_____ is when physical memory is only allocated when the process is trying to access it?

A

Allocation on first touch

21
Q

What is the reason for allocation on first touch?

A

To make sure that physical memory is only allocated when it’s really needed

22
Q

What is the purpose of multi-level page tables?

A

To lower the size of a page table as the OS maintains one per process

23
Q

What are inverted page tables?

A

A page table managed on a system-wide basis as opposed to per process

24
Q

How does one determine the size of a page?

A

Number of bits in the offset

25
Q

How does the buddy allocator work?

A

Starts with some consecutive memory region that is free and is a power of two. Whenever a request comes in, the allocator subdivides the area into smaller chunks such that every one of them is also a power of two. IT will continue subdividing until it finds a small enough chunk that is power of two that can satisfy the request

26
Q

How does the slab allocator work?

A

Builds custom object caches on top of slabs where each slab represents contiguously allocated physical memory

27
Q

_____ is the process by which physical page frames can be repeatedly saved and stored to and from some secondary storage?

A

Paging/Demand Paging

28
Q

What happens when a page is not present in memory?

A

It has its present bit in the paging table entry set to 0

29
Q

When should pages be swapped out of main memory and on to disk?

A

Periodically when the amount of occupied memory reaches a particular threshold

30
Q

Which pages should be swapped out?

A

Pages that wont be used in the future

31
Q

____ is a page replacement policy in which we look at how recently a page has been used and use that to inform a prediction about the page’s future use?

A

Least Recently Used (LRU)

32
Q

In addition to LRU, what are other candidates for pages that can be freed from physical memory?

A

Pages that don’t need to be written out to disk

33
Q

What is the default replacement algorithm in Linux?

A

Second chance - Performs two scans before determining which pages are the ones that should be swapped out