Memory Flashcards

1
Q

What do computers use to hold data?

A

Computers use memory, which is a large array of equal-sized storage spaces, to hold data.

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

How are locations in computer memory identified?

A

Each location in computer memory has its own identifier, usually expressed as a hexadecimal number, which is called the address of the location.

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

What is stored inside each location in computer memory?

A

Inside each location in computer memory, there is a value which represents the data. The data can represent various things such as numbers, letters, colours, etc.

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

How can you retrieve the data stored at a specific memory address?

A

Given an address, you can look up the data stored at that address in computer memory.

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

What can you do with most computer memory?

A

Most computer memory can be both read and written, allowing you to store variables and modify their values.

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

What is the meaning of “RAM” in computer memory?

A

“RAM” stands for Random Access Memory, which is a type of computer memory that is both readable and writeable. The term “random” indicates that any address in the memory is equally accessible to the computer.

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

Can memory other than RAM be randomly accessed?

A

Yes, memory other than RAM, such as Read Only Memory (ROM), can also be randomly accessed, although it may have different characteristics or limitations.

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

What happens to memory availability when one process uses up some of it in a simple system without virtual memory?

A

In a simple system without virtual memory, when one process uses up some proportion of the memory, it becomes unavailable for other processes.

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

What are logical memory segments in a process?

A

Logical memory segments are contiguous parts of the address space that any process requires. They can vary in number and function.

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

What are some typical examples of logical memory segments and their properties?

A

Code: Executable binary, fixed size, read-only.
Read-only data: Strings, tables, fixed size, read-only.
Static data: Global variables, fixed size, read/write.
Stack: Local variables, dynamic, read/write.
Heap: Run-time structures, dynamic, read/write.

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

What is responsible for memory as a resource in a computer?

A

The operating system (OS) is responsible for memory as a resource in a computer.

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

What are some tasks performed by the operating system for memory management?

A

Allocating spaces when a process is loaded.
Setting up pages in a virtual memory system.
Managing access permissions.
Allocating additional space if the stack or heap overflows.
Keeping track of a process’ use and recovering the resource when the process terminates.

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

Can memory management be done by both the application and the operating system?

A

Yes, memory management can be done by both the application and the operating system. The application may request large blocks of memory and allocate from them, while the OS has the ultimate responsibility for memory management.

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

What information does the operating system keep track of in a virtual memory environment?

A

In a virtual memory environment, the operating system keeps records of the memory in use and which physical pages are in use, along with the purposes for which they are used.

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

What determines the size of the virtual address space in a computer processor?

A

The size of the virtual address space in a computer processor is fixed by the architecture of that processor.

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

What is the typical pattern for the size of virtual address spaces in binary systems?

A

The size of virtual address spaces in binary systems tends to be a power of two, most likely a power of a power of two.

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

What are the sizes of 16-bit, 32-bit, and 64-bit virtual address spaces?

A

16-bit spaces: 2^16 = 65,536 locations (or 64Ki)
32-bit spaces: 2^32 = 4,294,967,296 locations (or 4Gi)
64-bit spaces: 2^64 = 18,446,744,073,709,551,616 locations (or 16Ei)

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

What is the typical assumption for the size of “locations” in a virtual address space?

A

In most cases, “locations” in a virtual address space are assumed to be 8-bit bytes.

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

How does the physical memory size tend to change over time?

A

The physical memory size tends to expand as technology progresses, with falling prices per bit of memory, following a trend loosely aligned with Moore’s Law.

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

Why does the address space in a particular machine architecture often appear larger than the physical memory available to most users?

A

Machine architectures often have address spaces that are much larger than the physical memory available to most users, resulting in mostly empty address space while physical RAM is limited.

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

What happens as memory becomes more affordable over time?

A

As memory becomes more affordable, mechanisms may be developed to allow mapping of a physical address space larger than the virtual address space visible to any single process, enabling storage of data from multiple processes concurrently.

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

What occurs when new machine architectures with bigger address spaces are introduced?

A

When new machine architectures with bigger address spaces are introduced, the cycle of expanding address spaces and increasing memory affordability starts again.

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

What is the purpose of computer memory in relation to running processes?

A

Computer memory is a physical storage medium that holds one data item per location (address), and a running process uses an address to specify a location to load or store data in memory.

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

How are addresses used by different processes in a multiprocessing system?

A

In a multiprocessing system each process has its own independent set of addresses it wants to use to ensure they do not interfere with each other.

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

What is virtual memory and how does it address the issue of process interference?

A

Virtual memory allows each process to attempt to use any virtual address without interfering with other processes. It provides a mapping between virtual addresses and physical addresses.

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

How are virtual addresses translated to physical addresses in a virtual memory system?

A

In a virtual memory system, a process’s virtual address is translated to a physical address through a process called address translation, where each physical location has a single correspondence with a process-plus-virtual-address combination.

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

What are some properties of memory access that are exploited during address translation?

A

Very few processes use the entire virtual address space.
Locality of access is typically observed, meaning that if one address is used, addresses around it are also likely to be used.

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

How are virtual addresses organized and translated in address translation?

A

Addresses are organized into pages, and translations are done on a per-page basis.
Page tables are used to perform the translations, with the most significant bits of the address defining the page number.
Aliasing multiple virtual pages to the same physical page is possible but not commonly used.
Not all virtual pages need an allocation of physical RAM, and pages can be marked as ‘invalid’ if not needed.

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

What is the role of the Memory Management Unit (MMU) in memory mapping?

A

The mapping between virtual addresses and physical addresses is done by the MMU, which is a hardware component responsible for performing address translations using page tables stored in RAM.

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

How is the issue of table size addressed in larger address spaces?

A

In larger address spaces, hierarchical page tables are used to address the problem of table size. Hierarchical page tables reduce the size of the tables by organizing them in a hierarchical structure, enabling efficient memory utilization for processes.

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

What is the problem with using large page tables for every process in a real memory mapping scenario?

A

Using large page tables for every process can result in a significant memory overhead. For example, in a 32-bit system, a single-level page table may require several megabytes of memory for supporting a relatively small utility, making it inefficient. Similarly, in a 64-bit system, the memory requirement for page tables becomes infeasibly large.

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

What is the von Neumann computing architecture known for?

A

The von Neumann computing architecture, the most common architecture, has a single memory address space shared by code and data in all their forms.

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

How is memory divided in the von Neumann architecture?

A

Memory is logically divided into regions in applications, with the most common division being between ‘code’ and ‘data’. ‘Code’ refers to the processor’s instructions, while ‘data’ encompasses variables that can be written to.

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

What are segments in the context of memory management?

A

Segments are logical divisions of memory that group related parts together. Each process has its own set of segments, which can have different attributes and sizes.

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

How have segments historically been implemented in memory management?

A

Historically, segments were supported as dedicated parts of memory with their own addresses and hardware mappings. However, this approach is uncommon today as segments are typically mapped using hardware pages and organized by software.

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

Do operating systems still use segment tables for memory allocation?

A

Yes, operating system software may still maintain segment tables to allocate pages appropriately, even though logical segments are mapped using hardware pages.

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

What are some examples of logical divisions or segments in computing?

A

Logical divisions or segments can be found in various software tools. For example, in Unix binaries, files are organized into segments, providing a standard for file organization.

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

What is the significance of the term “segmentation faults”?

A

The term “segmentation faults” refers to errors that occur when accessing memory segments improperly or in violation of their defined attributes. These errors can cause program crashes or unexpected behaviour.

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

Why is it important to protect computer memory?

A

Protecting computer memory ensures that each process has its own private space inaccessible to other processes, preventing contamination and unauthorized access.

40
Q

What are the components of the operating system space that need protection?

A

The components of the operating system space that require protection include operating system code, operating system data, and memory-mapped peripheral devices.

41
Q

How is memory protection achieved through memory mapping?

A

Memory mapping limits a process’s memory access to the currently mapped regions. The operating system handles the mapping, allowing user applications to interact with operating system services.

42
Q

What factors are considered when validating memory access?

A

Memory protection validates a particular access based on the requested (virtual) address, the specific action being performed, and the privilege level of the processor at that time.

43
Q

What are some examples of permissions that can be implemented for memory access?

A

Examples of permissions for memory access include “No access,” “Supervisor read-only,” “Supervisor read/write,” “Read-only,” and “Read/write by any privilege level.”

44
Q

What does it mean when a page is marked as “No access”?

A

Marking a page as “No access” indicates that the page is not present or that the process has not been granted access to that part of the address space. It can lead to a segmentation fault.

45
Q

Why are certain areas marked as “Read-only”?

A

Areas such as fixed instruction code or data structures like message strings are marked as “Read-only” to prevent accidental overwriting and enhance process robustness.

46
Q

What is the significance of marking the operating system’s data spaces as “Supervisor read/write”?

A

Marking the operating system’s data spaces as “Supervisor read/write” prevents unauthorized alteration by user processes. System calls provide a trusted means of access for necessary modifications.

47
Q

What permission level is typically assigned to user’s data pages?

A

User’s data pages are typically assigned “Read/write by any privilege level” permission. The operating system retains full access but restricts its modifications to necessary operations.

48
Q

What is one of the important functions of an operating system?

A

Providing an abstracted virtual environment for application code.

49
Q

How does virtual memory solve address conflicts in a system with multiple applications?

A

Each process has a private map that translates its virtual addresses into non-conflicting physical addresses, ensuring address conflicts are resolved.

50
Q

What benefits does virtual memory provide in terms of memory availability?

A

Virtual memory allows applications to assume that all the memory available in the virtual machine size is present, independent of other concurrent applications.

51
Q

What is the purpose of using secondary storage in virtual memory systems?

A

Secondary storage, such as magnetic disks, is used for swapping pages of memory when the demand on physical memory exceeds its capacity.

52
Q

What is the term used to describe the process of copying pages to disk in virtual memory systems?

A

Swapping or paging.

53
Q

How does excessive swapping affect system performance?

A

Excessive swapping slows down the system as each swap operation is time-consuming, leading to a decrease in overall performance.

54
Q

What are some factors that determine the need for more electronic memory (RAM)?

A

Running multiple applications or memory-hungry applications increases the demand for memory, requiring more RAM to delay the point where extensive swapping becomes necessary.

55
Q

What determines the extent of the virtual address space in a hardware architecture?

A

The hardware architecture of the machine determines the extent of the virtual address space. For example, a “64-bit” machine can address 2^64 bytes.

56
Q

What factors limit the amount of physical RAM that can be installed in a system?

A

The amount of physical RAM is limited by cost, power/cooling considerations, and physical space within the machine.

57
Q

What is a page in a virtual memory system?

A

A fixed-size block of memory used for dividing the virtual memory space.

58
Q

How can pages be mapped in a virtual memory system?

A

Any page can be mapped into any page frame, invisible to the user.

59
Q

What does the memory in a virtual memory system hold?

A

The memory holds a copy of some recently used pages, with the actual data residing on disk.

60
Q

What happens when a virtual page is marked as not resident in a virtual memory system?

A

The operating system intervenes by handling a page fault (bringing the virtual page into the physical memory), triggered by the memory management unit (MMU).

61
Q

What is demand paging?

A

Loading memory into physical memory when required, triggered by a page fault.

62
Q

What is a page fault in a virtual memory system?

A

A hardware-level exception that occurs when a virtual address fails to be translated into a physical address, usually because the page is not present in physical memory.

63
Q

How does the operating system handle a page fault in a virtual memory system?

A

The operating system’s exception handler determines if it is a genuine page fault, finds a page frame for the desired page, loads it from disk, and updates the page tables.

64
Q

What happens to the faulted process after a page fault is handled in a virtual memory system?

A

The operating system ensures that the faulted process is in the same state as if it had stopped just before the faulting operation, and the faulting operation is returned to as if it had been a call operation.

65
Q

How does paging affect application code in a virtual memory system?

A

Paging is not visible to the application code, allowing applications to proceed without being aware of the paging process.

66
Q

What is the advantage of using a cache in a virtual memory system?

A

The cache provides faster access to frequently used data, reducing the need to fetch data from slower memory.

67
Q

How does the cache in a virtual memory system handle data requests?

A

The cache intercepts requests and provides the data if available locally; otherwise, it fetches the data from slower memory, potentially evicting old data.

68
Q

How does paging in a virtual memory system work?

A

The memory management unit (MMU) intercepts and translates requests to RAM, fetching the data if present; otherwise, it fetches the data from slower disk storage, potentially evicting old data.

69
Q

What is a common assumption made in virtual memory systems regarding data access?

A

Locality of reference leads to a high probability of cache hits or page hits, making faster access more likely for most code and data structures.

70
Q

What is the role of a Memory Management Unit (MMU)?

A

The MMU performs virtual memory mapping and checks the current privilege to separate user processes and prevent caching of volatile memory regions.

71
Q

What are the inputs to the MMU?

A

The inputs to the MMU are a virtual memory address, an operation (read/write), and the processor’s privilege information.

72
Q

What are the outputs of the MMU?

A

The outputs of the MMU are a physical memory address and cachability information, or a rejection indicating a memory fault.

73
Q

What does the MMU do when there is a memory fault?

A

The MMU indicates a memory fault when there is no physical memory mapped to the requested page, an illegal operation (e.g., writing to a read-only area), or a privilege violation (e.g., user accessing operating system space).

74
Q

What is a cache in computers?

A

A cache is a copy of a small subset of a larger data set that is fast and convenient to access.

75
Q

What are the two types of locality that caches rely on?

A

Caches rely on temporal locality (recently used data will likely be used again) and spatial locality (if one address is used, nearby addresses are likely to be used).

76
Q

How does a cache operate?

A

A cache intercepts outgoing requests and satisfies them locally if it recognizes the data being requested. If not recognized, the operation proceeds without the cache, but the reference may be cached for future use.

77
Q

What are some examples of caching in operating systems?

A

Examples include the memory cache, the Translation Look-aside Buffer (TLB), and virtual memory where the addressable memory acts as a cache for larger physical memory backed by disk storage.

78
Q

Give an example of caching not in operating systems.

A

A network router may cache routing translations to speed up subsequent packet forwarding, and a web browser can cache recently accessed pages to avoid slow network communications when revisiting them.

79
Q

What is a memory cache?

A

A memory cache is a small, fast memory located close to the processor in high-performance computers.

80
Q

How are caches organized in high-performance machines?

A

In high-performance machines, caches are organized into multiple levels. The closest cache to the processor is called “level 1” cache, and there may be additional levels such as “level 2” cache.

81
Q

What is a virtual cache?

A

A virtual cache is a cache that operates using virtual addresses and is typically used for the level 1 cache in high-performance systems.

82
Q

What type of addresses do lower cache levels typically use?

A

Lower cache levels typically use physical addresses, which are below any memory mapping.

83
Q

When does a virtual cache require flushing?

A

A virtual cache needs to be flushed during a context switch, as the meaning of a particular virtual address may change.

84
Q

How does a typical level 2 cache behave in terms of retaining its contents?

A

A typical level 2 cache may use physical addresses and can retain its contents through multiple process changes, potentially until they become useful again to the current process.

85
Q

Why does the operating system scheduler need to be aware of caches?

A

The operating system scheduler needs to be aware of caches that require flushing during context switches to maintain cache consistency.

86
Q

How does a shared-memory multiprocessor handle cache hierarchy?

A

In a shared-memory multiprocessor, each processor core may have separate level 1 caches for instructions and data using virtual addresses. Further down the cache hierarchy, all processor cores can share a physical cache, improving overall utilization.

87
Q

What is a DMA controller?

A

A DMA controller is a hardware component that facilitates data movement between different locations, such as memory and I/O devices, without the direct involvement of the CPU.

88
Q

Why is a DMA controller useful for certain computing processes?

A

A DMA controller is useful for processes that involve repetitive data transfer tasks because it reduces CPU idle time, improves energy efficiency, and allows the CPU to focus on more complex computing tasks.

89
Q

How is a DMA transfer set up?

A

A DMA transfer is set up by the CPU, specifying the source (e.g., disk input device), destination (e.g., memory), and the length of the data to be transferred.

90
Q

What happens during a DMA transfer?

A

During a DMA transfer, the DMA controller waits for data, loads the data from the input device, stores the data in memory, increments the memory pointer, and may generate an interrupt to signal completion or set up another data transfer.

91
Q

What is the role of the interrupt in DMA transfers?

A

The interrupt generated by the DMA controller can be used to set up another data transfer or to trigger a context switch in the case of paging operations.

92
Q

What is important to note about the DMA controller’s operation?

A

The DMA controller operates on physical addresses and is independent of any MMU (Memory Management Unit). Physical pages involved in DMA transfers need to be pinned to ensure they are not reused until the transfer is complete.

93
Q

What are common applications of DMA controllers?

A

Common applications of DMA controllers include large I/O transfers and high-bandwidth I/O transfers, where the DMA controller can significantly improve data transfer efficiency.

94
Q

What additional capability can some DMA controllers have?

A

Some DMA controllers can perform memory-to-memory transfers, allowing for large block memory copies, which can be useful in scenarios such as graphics operations or data movement within the system.

95
Q

What technology has largely replaced DMA controllers in graphics operations?

A

More sophisticated GPUs (Graphics Processing Units) that have autonomous parallel access to memory have largely superseded DMA controllers in graphics operations.