Memory Management Flashcards
what is paging?
where memory is split into blocks of a fixed size with physical division
programs are split into fixed sizes which can then be easily slotted into any free spaces in RAM
Advantage of paging
incredibly simple, just break up the memory into fixed chunks
Disadvantage of paging
ignores programs structure/flow
loops and large data structures can end up going into multiple pages and end up jumping into RAM
What is segmentation?
where programs are broken up into logical divisions
each block has a varying size
could be split into segments such as instructions and data
Advantage of segmentation
keeps major sections of the program together reducing inconvenient jumps around RAM
Disadvantage of segmentation
complicated to know where to split programs up
Paging and segmentation
no reason cant use both
in a modern OS the smallest size a segment can be is the size of a single page
e.g windows and linux default page size in 4kib
Paging and segmentation disadvantage
will be wasted space if a processor doesn’t use an entire page of memory as only one process can exist in a single page
What is virtual memory?
enables the use of secondary storage to store loaded programs that are not currently being executed
as secondary storage has significantly more storage capacity than RAM we can also load massive programs
we do this by moving pages into seconday storage
Advantage of virtual memory
allows programs that wouldn’t normally fit into RAM to still be executed
Disadvantages of virtual memory
incredibly slow (secondary storage is significantly slower than RAM)
if being used a lot it can significantly shorten the lifespan of secondary storage device, storage thrashing