to go over the concepts that have been covered in the lecture so hopefully I won't "fail" this course the second time.
I've been dealing with the memory management problems all the time when I implementing
the thread sub-system and system call functions.
Why should each process has its own address space? Why do we even come to this abstraction?
First, we want to protect the OS from being modified or trashed or whatever easily because of easy access to physical memory.
Second, we want to run multiple programs at once.
When multiple programs are running, two programs present: protection and relocation.
Address space creates a kind of abstract memory for programs.
It is a set of addresses for processes to address memory.
Each process then owns its private address space, continuous and contiguous.
An important concept to remember is "Address Translation". It is the process of mapping addresses in the programs, mostly referred to the variables or symbolic addresses that
programmers use, into physical addresses.
To deal with memory problems, two strategies are commonly used: swapping and virtual memory.
Swapping means to swap process in and out from memory and to put the inactive process
on the disk. Virtual memory allows program to run even when they are partially in main memory. This is insane technology! I will go over it later since there's quite a few things.
In the lecture, we discussed about the Partition problem. Process will grow as they run.
We must determine whether to partition the memory into fixed-size chunks or dynamically
allocate the memory. We want to allocate extra memory for a process to reduce the overhead
associated with swapping processes that no longer fit in out from the memory.
It is somewhat complicated here. Let's start over again.
When the space is no longer large enough for a process, it will be swapped out and it has
to wait until a lager hole in the memory becomes available. The static/fixed-size allocation
is simpler to implement, but it creates Internal Fragmentation. In this case, memory
is wasted if process in a partition is smaller. For programs that are larger than the partitions,
we have Overlay problems. Then those programs have to get the hell out of the memory. (:<)
Gotta sleep now.
To be continued...
1 comment:
The OS161 project was pretty cool. Is there a working implementation or an example of an implementation we could look at? Would be interested to see how different people went about doing this.
Thanx
Post a Comment