Memory management without virtual memory Flashcards
What is the thing called in the operating system that manages the memory hierarchy?
Memory manager
What does the memory manager do?
Keep track of what bits of memory are being used.
Allocate memory accordingly.
Dealloacate memory when a process is done.
What is the easiest form of memory management?
Running one program at a time and allocating memory to it.
What does multiprogramming allow for?
If one process is blocked waiting for something like I/O, a process switch occurs and the CPU gets on with something else. This reduces the amount of time that the CPU is idle.
Name one basic form of memory management?
Separating the memory into partitions.
Putting a process into a queue of the smallest portion large enough to hold it.
Why is separating memory into partitions and a queue potentially problematic?
Because you could have one large memory partition and lots of small jobs. If the queue system was rigid, you’d have a situation where, despite their being memory space in a large partition, you couldn’t allocate it.
How else might a queue be used in memory allocation?
Single queue for all jobs. If partition space becomes free, then job loaded and run.
Why might a single queue and jobs be bad?
Because it prioritises large jobs. This means small jobs might be shut out of being run, which in interactive systems could be the difference between speedy running and sluggish running.
How might you get around a problem of small jobs and a single queue?
1) Always have a small partition space for small jobs.
2) Have a rule that if a jobs is skipped a certain number of times, it gets a point. And then it gets allocated memory.
Define swapping:
bringing in each process in its entirety, running it for a while, then putting it back on disk
How does virtual memory work, at a high level
Allows programs to run even when they are only partially in main memory.
Why is dynamic partitioning with swapping good
Good memory utilisation
Why is dynamic partitioning and swapping challenging
Allocating and deallocating memory has to be managed and tracked
What is memory compaction?
When all processes are moved downward as far as possible.
Why is memory compaction rare?
Requires a lot of CPU time.
What happens if a process grows?
Potentially problems. Especially if it attempts to hit another process.
How is memory divided with bitmaps
allocation units
what corresponds with each allocation unit in a bitmap
allocation bit which is 0 if the unit is free and 1 if it is occupied
why is size of allocation unit in bitmap important?
smaller allocation unit = larger bitmap
what is the main problem with bitmaps?
when a process is brought into memory, memory manager must search to find a run of bits in the map. this is slow.
Define first fit allocation
Memory manager looks for first big enough hole.
It’s fast.
Define next fit
works in the same way as first fit allocation only that it keeps track of the hole it last filled = less searching.
Define best fit
best fit searches entire list and takes smallest adequate hole.
Define worst fit
find the biggest hole and put the process in there