Chapter08Rev13 - Chapter 8(Revision number 13 Memory System...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Chapter 8 (Revision number 13) Memory System and Memory Management Let us review what we have seen so far. On the hardware side, we have looked at the instruction-set of the processor, interrupts, and designing a processor. On the software side, we have seen how to use the processor as a resource and schedule it to run different programs. The software entities we have familiarized ourselves with include the compiler and linker that live above the operating system. We have also familiarized ourselves the loader and process scheduler that are part of the operating system. By now, we hope we have de-mystified some of the magic of what is inside “a box”. In this chapter, we continue unraveling the box by looking at another important component of the computer system, namely, the memory. 8.1 Basics What is memory management? Just like the processor, memory is a precious resource and the operating system ensures the best use of this resource. Memory management is an operating system entity that provides the following functionalities. 1. Better resource usage Since the memory is a precious resource, it is best to allocate it on demand. For example, even though the memory footprint of the program includes the heap there is no need to allocate this to a program at startup. It is sufficient to make the allocation if and when the program dynamically requests it. Further, if a process is not actively using memory allocated to it, then perhaps it is best to release it from that process and use it for some of other process. Both these ideas will lead to better resource utilization of the memory resource. 2. Independence and Protection We mentioned that several processes are co-resident in memory at any point of time. A program may have a bug causing it to run amok writing into areas of memory that is not part of its footprint. How do we protect a buggy process from itself and from other processes? Further, in these days of computer viruses and worms, a malicious program could be intentionally trying to corrupt the memories of other genuine programs. Therefore, the memory manager provides independence for each process, and memory protection from one another. 3. Liberation from resource limitations It is ideal for the programmer not to worry about the amount of physical memory while developing his/her program. The memory manager provides to the programmer an illusion of memory that is larger than the physical memory size. 4. Sharing While memory protection among processes is necessary, sometimes processes may want
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 to share memory either implicitly or explicitly. For example, you may have several terminal sessions opened on your desktop. Each of them may be running the same shell program but with different data (for example, location of the terminal on your desktop screen). This is an example of implicit sharing among processes. An instant messaging program between two users who are on the same time-shared computer is an instance of explicit data sharing. The memory manager facilitates memory sharing when needed
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 50

Chapter08Rev13 - Chapter 8(Revision number 13 Memory System...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online