Topic 12 – Memory management Flashcards

1
Q

describe what

reloaction

is

A

this is a mechanism provided by the memory management module that enables a process to be loaded anywhere in memory and still be able to function

note

  • this is essential in cases where programs may be written to use the same addresses in memory
  • to enable this there will ususally be some implementation of a virtual memory system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

name 4

tasks that the memory management modue

must carry out in order to provide a multitasking environment

A

the tasks this carrys out are:

  1. Allocating memory
  2. Relocation
  3. Protection
  4. Dealing with limited memory size
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

describe the linux file

/proc/swaps

A

this is a file that contains details about the swap spaces that are available such as partition and file swaps.

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

describe the following state:

Modify bit

Reference bit

1

1

A

what state are the modify bit and reference bit in when:

Page modified and referenced

(dont swap highly likely to be used again)

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

what is

paged virtual memory

A

this is a modern approach that operating systems use to handle memory

it invloves slicing memory into what are known as pages typically one page will be 4KiB

it also involves processes being alloacted virtual memory and the MMU will always translate to physical addressses

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

TRUE

each process will have its own page table

A

true/false

each process has its own page table

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

this is a memory address that is used by an application program and executed by the processor

it does not correspond to the real location of the resource in memory but will later be mapped to a physical memory address represnting where the resource actually exists in memory

A

what is a

logical/virtual address

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

this involves:

  1. logical/virtual memory addresses being sent to the processor by an application programs
  2. the processor executes and sends the logical address to a component built into the processor known as the memory mangement unit (MMU)
  3. the memory management unit (MMU) will translate the logical memory addresss to the physical memory address
A

how does a

virtual memory system

operate in 3 steps

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

false

the contents of the Translation look-aside buffer (TLB) is not saved upon a context switch.

instead it is flushed and repopulated for the new process

A

true/false

is the contents of the

Translation look-aside buffer (TLB)

saved on a context switch

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

name 2 instances upon which a

page fault can occur

A

this can occur when either:

  1. The page entry is part of the logical address space but it is currently in swap space
  2. The page may not be in the logical address space of the process; for example, a bug may cause a reference to an address outside the process’s address limit.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

describe the following state

Modify bit

Reference bit

1

0

A

what state are the modify bit and reference bit in when:

Page is modified and not referenced

(can be written to swap as is unlikely to be used again, this could be initialisation instructions or error handling instructions page)

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

when this occurs:

  1. an interrupt will occur
  2. the page fault handler will deal with the page fault
A

what events are called when a page table entry is marked as invladid

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

this is a part of the operating system kernel and is charged with the management of memory

A

what is the

Memory Management Module

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

This command is used to show information about virtual memory and various events such as interrupts

A

describe the linux command

vmstat

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

what is the default unit

used by the linux free command

A

the default unit that this uses is

kibibyte

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

this is cache that is dedicated to holding entries from a page table.

it is used by the Memory Management Unit so that it can translate pages from here instead of from main memory.

if the MMU always had to go to main memory then it would be a bottlneck for the CPU

A

what is the

Translation look-aside buffer (TLB)

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

the execution process for this is as follows:

  1. All processes will be allocated logical memory and they will access their data using logical addresses
  2. When a program executes a logical address on the CPU the MMU will translate it using a page table
  3. If the logical address was 3D49 then the MMU would use the page number 3 as an index to the page table
  4. index 3 of the page table will tell the MMU the physical page number inside physical memory
  5. The MMU then combines the found physical page number with the offset of the logical address to reveal the true physical address in memory
A

describe the execution process of

paged virtual memory

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

what events are called when a page table entry is marked as invladid

A

when this occurs:

  1. an interrupt will occur
  2. the page fault handler will deal with the page fault
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

this is overcome by the operating system by

making use of a modify bit (dirty bit) and a reference bit which are stored with each entry in the page table and is updated by the MMU

A

how does the operating system appropriately decide which pages should be swapped in order to overcome swapping problems

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

what are 4 advantages and 1 disadvantage of paged virtual memory

A

advantages

  1. efficeient swapping -Swapping occurs in small chunks instead of entire processes
  2. better space utilization - Memory is allocated in small chunks so space is not wasted
  3. flexible reloction - Relocation is more flexible since it can be done on a page by page basis. instead of relocating an entire block of instructions the instructions that overlap can be paged and moved and the rest of the instructions that do not overlap can be left as is
  4. increased protection - protection can also be applied on a page by page basis and allow shared access to specific pages reducing scope for error or malicious code to attack

Disadvantages:

  1. page table size - Because page sizes are so small a page table for a process can grow extremely large. However some MMU hardware will allow for larger page sizes such as 1MiB or 1GiB.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

this is a file that contains details about the swap spaces that are available such as partition and file swaps.

A

describe the linux file

/proc/swaps

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

if this was the case it would be catastrophic and a bottlneck for the cpu since the memory management unit would have to make two trips to main memory every time an instruction was executed

  1. To translate the logical address to the physical address using the page table in main memory
  2. To extract the instruction or data from main memory once the physical address has been translated by the MMU
A

what would happen if the

Memory Mangement Unit (MMU) did not have the dedicated Translation look-aside buffer (TLB)

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

what is the

Translation look-aside buffer (TLB)

A

this is cache that is dedicated to holding entries from a page table.

it is used by the Memory Management Unit so that it can translate pages from here instead of from main memory.

if the MMU always had to go to main memory then it would be a bottlneck for the CPU

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

what were the

base and length registers

historically used for

A

these were historically used so that a virtual memory system could be implemented

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
how does the **Translation look-aside buffer (TLB)** manage **holding only a fraction of a page table**
this can be pulled of by the Translation look-aside buffer (TLB) because of a phenomenom known as locality of reference. the TLB can be updated as locality changes
26
what is the ## Footnote **page table**
this is a table that is used by the Mmeory Management Unit (MMU) in order to translate logical page addresses to physcal page addresses
27
describe the linux directory **/proc**
this directory within linux is used to hold any data that is generated on the fly by the operating system during its session. The contents is created on boot and is discarded at shut down
28
describe the following state: ## Footnote Modify bit Reference bit 0 1
what state are the modify bit and reference bit in when: Page not modified but has been referenced (dont swap is likely to be used again as could be a data page)
29
how does a **virtual memory system** operate in 3 steps
this involves: 1. logical/virtual memory addresses being sent to the processor by an application programs 2. the processor executes and sends the logical address to a component built into the processor known as the memory mangement unit (MMU) 3. the memory management unit (MMU) will translate the logical memory addresss to the physical memory address
30
what is the ## Footnote **length register**
this was used to hold the value of the maximum virtual address that the program used. This value ensured that the program could not access address space outside of what it had been allocated
31
what problem that the memory mangement module must handle does a **virtual memory system** solve
the problem that this solves for the memory management module is the problem of reloaction
32
these were historically included inside the processor so that they could be used to implement a virtual memory system
what are **base and length registers** used for
33
what is the outcome of typing the linux command **Vmstat -s**
this will display a table providing information such as memory usage and other system events
34
this will display a table providing information such as memory usage and other system events
what is the outcome of typing the linux command **Vmstat -s**
35
what is a ## Footnote **page fault**
this is an event that occurs when a logical memory address cannot be translated to a physical memory address
36
in this case: such as malware or buggy code the Memory Management Unit (MMU) would be able to detect it and generate an invalid address fault which is handled similarly to an interrupt so that the operating system can regain control of the processor
describe what would happen if the: **Memory Management Unit (MMU)** **compared a virtual address with the length register and** **discovered that it was outside the address range for the process**
37
this is a modern approach that operating systems use to handle memory it invloves slicing memory into what are known as pages typically one page will be 4KiB it also involves processes being alloacted virtual memory and the MMU will always translate to physical addressses
what is ## Footnote **paged virtual memory**
38
true/false is the contents of the **Translation look-aside buffer (TLB)** saved on a context switch
false the contents of the **Translation look-aside buffer (TLB)** is not saved upon a context switch. instead it is flushed and repopulated for the new process
39
This is initially set to 0 and is rest to 0 any time: * that the page is swapped * a page fault occurs * being scheduled for a reset by an interrupt . When this is set to 1 it means that this page has been read
what is the ## Footnote **reference bit**
40
describe the steps that the page fault handler will take after a page fault interrupt has been sent to the processor
the steps for this event include: 1. It will check to see if the logical address is actually within the limits of what the process was allocated by referencing the processes control block (context block). if it is out of range then the operating system can terminate the process with an error message 2. If the logical address is valid then the page entry must be in swap space and so the operating system begins the process of retrieving the page from the swap space to main memory the steps involved are: 1. The operating system will find a free page in memory 2. Schedule a disk operation to transfer the page from secondary storage to main memory 3. place the process in a blocked state 4. On completion update the page table with the physical address and mark it as valid 5. Restart the instruction that caused the page fault
41
this is a memory address that corresponds to the real location in memory of a resource
what is a ## Footnote **Physical address**
42
within this system * **virtual memory -** is allocated to every process in which it will have its instructions loaded in a contigous manner as usual, this memory will also be divided into pages * **physical memory -** this is the actual place where the resource can be found the available memory is split up into pages and pages may be scattered across memory, though this is no problem for the execution since the process will be executing virtual addresses in contigious order and they will be translated
within a paged virtual memory system describe * virtual memory * physical memory
43
this is a mechanism provided by the memory management module that enables a process to be loaded anywhere in memory and still be able to function _example_ if two processes were written so they always made use of the same memory address and these two processes just happend to use the same addresses then thier would be a collision. this mechanism solves this problem. one solution is the use of logical memory addresses
describe the function of **relocation** that the memory management module provides
44
1. What happens if memory is completely full but a page must be swapped in? 1. In this case a page is first swapped out and then another page is swapped in. This has doubled the amount of swaps that otherwise would have been if memory wasn’t completely full 2. What happens if a page is swapped but then shortly needed again and what if this occurs on a regular basis? 1. If this occurs then the operating system has no choice but to keep making swaps and if this occurs on a regular basis then processing time is being wasted on non productive operations the result is an issue known as thrashing or disk thrashing where the secondary storage is frequently being accessed for pages that are needed in memory this slows the system down significantly
what are two ## Footnote **issues of swapping that must be solved**
45
what state are the modify bit and reference bit in when: Page not modified but has been referenced (dont swap is likely to be used again as could be a data page)
describe the following state: ## Footnote Modify bit Reference bit 0 1
46
name an advantage and disadvantage of ## Footnote **swapping**
* advantage - this method effectively creates more memory than there actually is meaning more processes or data can be used at a time * disadvantage - the process of transferring data from memory to secondary storage is very time consuming and so this technique must use well thought out techniques to increase efficiency
47
describe the execution process of ## Footnote **paged virtual memory**
the execution process for this is as follows: 1. All processes will be allocated logical memory and they will access their data using logical addresses 2. When a program executes a logical address on the CPU the MMU will translate it using a page table 3. If the logical address was 3D49 then the MMU would use the page number 3 as an index to the page table 4. index 3 of the page table will tell the MMU the physical page number inside physical memory 5. The MMU then combines the found physical page number with the offset of the logical address to reveal the true physical address in memory
48
what is the ## Footnote **swap space**
this is a place on secondary storage that the memory management module can use to transfer unused data from the main memory to the secondary storage. This space will be either a dedicated partition or a file
49
this function of the memory management module includes: giving processes thier own space in memory and at the same time keeping track of what memory has been used and what memory is free
describe the process of **allocating memory** that the memory management module must carry out
50
this can occur when either: 1. The page entry is part of the logical address space but it is currently in swap space 2. The page may not be in the logical address space of the process; for example, a bug may cause a reference to an address outside the process’s address limit.
name 2 instances upon which a ## Footnote **page fault can occur**
51
true/false each process has its own page table
TRUE each process will have its own page table
52
the execution process for this is: 1. processor sends a virtual memory address to the Memory Management Unit (MMU) 2. the MMU checks the virtual memory address against the address held in the length register to ensure it is not an address outside of the processes scope 3. the MMU retreives the value from the base register and adds it to the virtual memory address to create a physical memory address 4. the MMU then contacts memory using the found physical memory address
describe the execution process of a ## Footnote **virtual memory system using base and length registers**
53
describe the execution process of a ## Footnote **virtual memory system using base and length registers**
the execution process for this is: 1. processor sends a virtual memory address to the Memory Management Unit (MMU) 2. the MMU checks the virtual memory address against the address held in the length register to ensure it is not an address outside of the processes scope 3. the MMU retreives the value from the base register and adds it to the virtual memory address to create a physical memory address 4. the MMU then contacts memory using the found physical memory address
54
this is a range of addresses typically of length 4KiB it is represented as for example 3D49 where 3 is the page number and D49 is an address within the page this is known as the offset
what is a **page** within a paged virtual memory system **and how is it represented**
55
the default unit that this uses is kibibyte
what is the default unit ## Footnote **used by the linux free command**
56
what is ## Footnote **locality of reference**
this is a phenomenom that exists within most programs where an application program typically only executes a local area of code and data at a time
57
this is a place on secondary storage that the memory management module can use to transfer unused data from the main memory to the secondary storage. This space will be either a dedicated partition or a file
what is the ## Footnote **swap space**
58
describe the function of **relocation** that the memory management module provides
this is a mechanism provided by the memory management module that enables a process to be loaded anywhere in memory and still be able to function _example_ if two processes were written so they always made use of the same memory address and these two processes just happend to use the same addresses then thier would be a collision. this mechanism solves this problem. one solution is the use of logical memory addresses
59
* advantage - this method effectively creates more memory than there actually is meaning more processes or data can be used at a time * disadvantage - the process of transferring data from memory to secondary storage is very time consuming and so this technique must use well thought out techniques to increase efficiency
name an advantage and disadvantage of ## Footnote **swapping**
60
this is a table that is used by the Mmeory Management Unit (MMU) in order to translate logical page addresses to physcal page addresses
what is the ## Footnote **page table**
61
what is the ## Footnote **swap space**
this is a place on secondary storage that the memory management module can use to transfer unused data from the main memory to the secondary storage. This space will be either a dedicated partition or a file
62
within a paged virtual memory system describe * virtual memory * physical memory
within this system * **virtual memory -** is allocated to every process in which it will have its instructions loaded in a contigous manner as usual, this memory will also be divided into pages * **physical memory -** this is the actual place where the resource can be found the available memory is split up into pages and pages may be scattered across memory, though this is no problem for the execution since the process will be executing virtual addresses in contigious order and they will be translated
63
when this event occurs its address within the page table will be marked as invalid
when a page is moved to secondary storage what happens to its address within the page table
64
what is a ## Footnote **Physical address**
this is a memory address that corresponds to the real location in memory of a resource
65
this is a mechanism provided by the memory management module that enables a process to be loaded anywhere in memory and still be able to function _note_ * this is essential in cases where programs may be written to use the same addresses in memory * to enable this there will ususally be some implementation of a virtual memory system
describe what **reloaction** is
66
describe what would happen if the: **Memory Management Unit (MMU)** **compared a virtual address with the length register and** **discovered that it was outside the address range for the process**
in this case: such as malware or buggy code the Memory Management Unit (MMU) would be able to detect it and generate an invalid address fault which is handled similarly to an interrupt so that the operating system can regain control of the processor
67
what actions can the **Memory Mangement Unit (MMU)** of a processor take on the page table
actions this can take are: 1. view - for translating logical page addresses to physical page addresses 2. add - if new pages are created (new process starting) 3. remove - if a page is to be evicted (process ended) 4. edit - if a physical page must be moved to a new location (from swap space and back again)
68
what is a ## Footnote **logical/virtual address**
this is a memory address that is used by an application program and executed by the processor it does not correspond to the real location of the resource in memory but will later be mapped to a physical memory address represnting where the resource actually exists in memory
69
describe the linux command ## Footnote **vmstat**
This command is used to show information about virtual memory and various events such as interrupts
70
this was used to hold the value that must be added to the programs virtual address. The MMU would use this value to make the translation from the virtual address to the physical address
what is the ## Footnote **base register**
71
what is the ## Footnote **base register**
this was used to hold the value that must be added to the programs virtual address. The MMU would use this value to make the translation from the virtual address to the physical address
72
what is a **page** within a paged virtual memory system **and how is it represented**
this is a range of addresses typically of length 4KiB it is represented as for example 3D49 where 3 is the page number and D49 is an address within the page this is known as the offset
73
describe the memory mangement modules task of ## Footnote **dealing with limited memory size**
this function of the memory management module can be summarised as: the memory mangement module must always seek to use the memory space as efficiently as possible and must also be able to deal with times where memory is running out due to created data or new processes being spawned one solution to this problem that the memory mangement module can take advantage of is known as the swap sapce
74
when a page is moved to secondary storage what happens to its address within the page table
when this event occurs its address within the page table will be marked as invalid
75
describe the function of **protection** that the memory management module must provide
this function of the memory management module can be summarised as: the memory management module must ensure that a processes allocated space in memory is protected and cannot be read or overwritten by another process _note_ under some circumstances processes sharing memory is beneficial
76
what state are the modify bit and reference bit in when: ## Footnote Page not modified and not referenced (Best choice for a swap as page has not been accessed)
describe this state of a page ## Footnote Modify bit Reference bit 0 0
77
this function of the memory management module can be summarised as: the memory mangement module must always seek to use the memory space as efficiently as possible and must also be able to deal with times where memory is running out due to created data or new processes being spawned one solution to this problem that the memory mangement module can take advantage of is known as the swap sapce
describe the memory mangement modules task of ## Footnote **dealing with limited memory size**
78
the problem that this solves for the memory management module is the problem of reloaction
what problem that the memory mangement module must handle does a **virtual memory system** solve
79
This command displays information about the system memory and the swap partition/file such as free and used space
describe the linux command ## Footnote **free**
80
describe what **swapping** is
this is a method that overcomes the issue of insufficient memory in the case that there is insufficient memory. the memory management module would be able to free up space by transferring a process in memory to secondary storage
81
what is the ## Footnote **modify bit**
This bit is initially set to 0 and is reset to 0 whenever it is loaded from swap space. 0 means that the page has not been written to and 1 means that the page has been written to
82
describe this state of a page ## Footnote Modify bit Reference bit 0 0
what state are the modify bit and reference bit in when: ## Footnote Page not modified and not referenced (Best choice for a swap as page has not been accessed)
83
this was used to hold the value of the maximum virtual address that the program used. This value ensured that the program could not access address space outside of what it had been allocated
what is the ## Footnote **length register**
84
the operating system module that controls this is the ## Footnote **memory management module**
which module of the operating system controls the **Memory Management Unit (MMU)** of the processor
85
also known as concatenate is a linux command that can be used to read files and output their contents or concatenate files and read and output each of their contents
desribe the linux command **cat**
86
This bit is initially set to 0 and is reset to 0 whenever it is loaded from swap space. 0 means that the page has not been written to and 1 means that the page has been written to
what is the ## Footnote **modify bit**
87
what are **base and length registers** used for
these were historically included inside the processor so that they could be used to implement a virtual memory system
88
what issues did **base and length registers** solve
these solved: * **relocation** - they enabled a virtual memory system to be implemented, so that processes could now be placed anywhere in memory regardless of how there own code was written * **protection** - this solved the issue of protection by holding a maximum address that the process could access
89
these were historically used so that a virtual memory system could be implemented
what were the **base and length registers** historically used for
90
this typically holds 64 pages
how many pages can the **Translation look-aside buffer (TLB)** typically hold
91
this is a method that overcomes the issue of insufficient memory in the case that there is insufficient memory. the memory management module would be able to free up space by transferring a process in memory to secondary storage
describe what **swapping** is
92
this directory within linux is used to hold any data that is generated on the fly by the operating system during its session. The contents is created on boot and is discarded at shut down
describe the linux directory **/proc**
93
the tasks this carrys out are: 1. Allocating memory 2. Relocation 3. Protection 4. Dealing with limited memory size
name 4 **tasks that the memory management modue** must carry out in order to provide a multitasking environment
94
this function of the memory management module can be summarised as: the memory management module must ensure that a processes allocated space in memory is protected and cannot be read or overwritten by another process _note_ under some circumstances processes sharing memory is beneficial
describe the function of **protection** that the memory management module must provide
95
the steps for this event include: 1. It will check to see if the logical address is actually within the limits of what the process was allocated by referencing the processes control block (context block). if it is out of range then the operating system can terminate the process with an error message 2. If the logical address is valid then the page entry must be in swap space and so the operating system begins the process of retrieving the page from the swap space to main memory the steps involved are: 1. The operating system will find a free page in memory 2. Schedule a disk operation to transfer the page from secondary storage to main memory 3. place the process in a blocked state 4. On completion update the page table with the physical address and mark it as valid 5. Restart the instruction that caused the page fault
describe the steps that the page fault handler will take after a page fault interrupt has been sent to the processor
96
this can be pulled of by the Translation look-aside buffer (TLB) because of a phenomenom known as locality of reference. the TLB can be updated as locality changes
how does the **Translation look-aside buffer (TLB)** manage **holding only a fraction of a page table**
97
which module of the operating system controls the **Memory Management Unit (MMU)** of the processor
the operating system module that controls this is the ## Footnote **memory management module**
98
this is a phenomenom that exists within most programs where an application program typically only executes a local area of code and data at a time
what is ## Footnote **locality of reference**
99
what state are the modify bit and reference bit in when: ## Footnote Page modified and referenced (dont swap highly likely to be used again)
describe the following state: ## Footnote Modify bit Reference bit 1 1
100
what is the ## Footnote **Memory Management Module**
this is a part of the operating system kernel and is charged with the management of memory
101
how many pages can the **Translation look-aside buffer (TLB)** typically hold
this typically holds 64 pages
102
what is the ## Footnote **reference bit**
This is initially set to 0 and is rest to 0 any time: * that the page is swapped * a page fault occurs * being scheduled for a reset by an interrupt . When this is set to 1 it means that this page has been read
103
how does the operating system appropriately decide which pages should be swapped in order to overcome swapping problems
this is overcome by the operating system by making use of a modify bit (dirty bit) and a reference bit which are stored with each entry in the page table and is updated by the MMU
104
what are two ## Footnote **issues of swapping that must be solved**
1. What happens if memory is completely full but a page must be swapped in? 1. In this case a page is first swapped out and then another page is swapped in. This has doubled the amount of swaps that otherwise would have been if memory wasn’t completely full 2. What happens if a page is swapped but then shortly needed again and what if this occurs on a regular basis? 1. If this occurs then the operating system has no choice but to keep making swaps and if this occurs on a regular basis then processing time is being wasted on non productive operations the result is an issue known as thrashing or disk thrashing where the secondary storage is frequently being accessed for pages that are needed in memory this slows the system down significantly
105
this is an event that occurs when a logical memory address cannot be translated to a physical memory address
what is a ## Footnote **page fault**
106
upon a context switch what will the ## Footnote **memory management module have to tell the Memory Management Unit (MMU)**
when this occurs the memory management module will have to tell the Memory Management Unit (MMU) where the page table for the new process is located in memory
107
desribe the linux command **cat**
also known as concatenate is a linux command that can be used to read files and output their contents or concatenate files and read and output each of their contents
108
advantages 1. **efficeient swapping** -Swapping occurs in small chunks instead of entire processes 2. **better space utilization** - Memory is allocated in small chunks so space is not wasted 3. **flexible reloction** - Relocation is more flexible since it can be done on a page by page basis. instead of relocating an entire block of instructions the instructions that overlap can be paged and moved and the rest of the instructions that do not overlap can be left as is 4. **increased protection** - protection can also be applied on a page by page basis and allow shared access to specific pages reducing scope for error or malicious code to attack Disadvantages: 1. **page table size** - Because page sizes are so small a page table for a process can grow extremely large. However some MMU hardware will allow for larger page sizes such as 1MiB or 1GiB.
what are 4 advantages and 1 disadvantage of paged virtual memory
109
what state are the modify bit and reference bit in when: ## Footnote Page is modified and not referenced (can be written to swap as is unlikely to be used again, this could be initialisation instructions or error handling instructions page)
describe the following state Modify bit Reference bit 1 0
110
what would happen if the ## Footnote **Memory Mangement Unit (MMU) did not have the dedicated Translation look-aside buffer (TLB)**
if this was the case it would be catastrophic and a bottlneck for the cpu since the memory management unit would have to make two trips to main memory every time an instruction was executed 1. To translate the logical address to the physical address using the page table in main memory 2. To extract the instruction or data from main memory once the physical address has been translated by the MMU
111
actions this can take are: 1. view - for translating logical page addresses to physical page addresses 2. add - if new pages are created (new process starting) 3. remove - if a page is to be evicted (process ended) 4. edit - if a physical page must be moved to a new location (from swap space and back again)
what actions can the **Memory Mangement Unit (MMU)** of a processor take on the page table
112
these solved: * **relocation** - they enabled a virtual memory system to be implemented, so that processes could now be placed anywhere in memory regardless of how there own code was written * **protection** - this solved the issue of protection by holding a maximum address that the process could access
what issues did **base and length registers** solve
113
when this occurs the memory management module will have to tell the Memory Management Unit (MMU) where the page table for the new process is located in memory
upon a context switch what will the ## Footnote **memory management module have to tell the Memory Management Unit (MMU)**
114
describe the process of **allocating memory** that the memory management module must carry out
this function of the memory management module includes: giving processes thier own space in memory and at the same time keeping track of what memory has been used and what memory is free
115
this is a place on secondary storage that the memory management module can use to transfer unused data from the main memory to the secondary storage. This space will be either a dedicated partition or a file
what is the ## Footnote **swap space**
116
describe the linux command ## Footnote **free**
This command displays information about the system memory and the swap partition/file such as free and used space