Lecture 1 Flashcards
Where are processes in virtual memory stored?
Secondary storage
Translation
Mapping between virtual memory address space and physical memory.
Valid region of memory
A main memory address space is free and large enough to hold the assigned page.
When do translations take place?
execution time when the Memory Management Unit (MMU) assigns each process chunks of
physical (main) memory.
Why is partial loading advantageous?
Many processes can execute at once, this increases the utilization of the CPU.
Page
A small chunk of memory that is a small part of the total memory needed for the process to execute.
Page table
Look up table containing virtual to phyiscal address mapping.
In physical memory what is the address space 28…31 reserved for?
OS-kernal level applications.
Why have virtual memory?
virtual memory uses secondary storage to create an
the illusion of even larger memory space.
Virtual memory manager
retrieves processes currently in secondary storage (virtual memory) for transfer to physical
memory.
Describe the three results of translation.
- Page table does translation
- Page is still in secondary storage and not accessible to MMU.
- Nothing happens. The virtual address referenced is invalid.
Demand paging
pages are allocated (on demand) to free frames
in main memory.
Where are the most used pages stored?
In a temporary memory cache for fast access and retrieval
What happens to pages in the main memory that are least used?
Written back to secondary storage.
Context switching
The process of swapping in and out parts of processes between virtual and main
memory.
What necessitates the use of paging?
Fine-grained control of what parts of what processes are currently in physical versus virtual memory
When does context switching occur?
When we switch between user and kernel
operations.
OS level software interrupt.
What makes up a process?
code, data, heap and stack
Heap
Dynamic memory allocation.
starts at a Min logical address and grows up
Stack
Static memory allocation
starts at a Max logical address and grows down
Advantage of the stack
memory is managed for the user, who
doesn’t have to allocate memory by hand, or free it once it isn’t needed any more.
Memory leak
User fails to deallocate memory that is no longer needed.
Why is frequent swapping between virtual and physical memory inefficient?
It requires an OS context switch.During a context switch the CPU is not being used.
Fragmentation
Wasted memory space