Memory Management
Memory management is the act of managing computer memory. In its simpler forms, this involves providing ways to allocate portions of memory to programs at their request, and freeing it for reuse when no longer needed. The management of main memory is critical to the computer system. Virtual memory systems separate the memory addresses used by a process from actual physical addresses, allowing separation of processes and increasing the effectively available amount of RAM using disk swapping. The quality of the virtual memory manager can have a big impact on overall system performance.
Objectives
While surveying the various mechanisms and policies associated with
memory management, it is well to keep in mind the requirements that
memory management is intended to satisfy. It suggests five requirements:
- Relocation
- Protection
- Sharing
- Logical organization
- Physical organization
Relocation
- in a multiprogramming system, the available main memory is generally shared among a number of processes.
- typically it is not possible for programmer to know in advance which are the programs that will reside in the memory during the execution time of a program.
- able to swap active processes in and out of main memory to maximize processors usage by providing a large pool of ready processes to execute.
- once a program has been swapped to disk, it would be quite limiting to declare that when it is next swapped back in it must be placed in the same main memory region as before.
Protection
· each process should be protected against unwanted interference by other processes, whether accidental or intentional.
· programs in other processes should not be able to reference memory locations in a process, for reading and writing purposes without permission.
· in one sense, satisfaction of the relocation requirement increases under difficulty of satisfying the protection requirement.
· because the location of a program in main memory is unknown, it is possible to check absolute addresses at compile time to assure protection.
Sharing
- any protection mechanisms that are implemented must have the
flexibility to allow several processors to access the same portion of main memory.
- for example, if a number of processes are executing the same program, it is advantageous to allow each process to access the same copy of the program rather than have it on separate copy.
- processes that are cooperating on some task may need to share access to the same data structure.
- the memory management system must therefore allow control access to shared areas of memory without compromising essential protection.
Logical Organization
- almost invariably, main memory in a computer system is organized as a linear, or one-dimensional, address space that consists of sequence of byte or words.
- secondary memory, at its physical level, is similarly organized.
- although the organization closely mirrors the actual machine hardware, it does not correspond to the way in which program are typically instructed.
Physical Organization
- computer memory is organized into at least two levels: main memory and secondary memory.
- main memory provides fast access at relatively high cost.
- main memory is volatile; that is, it does not provide permanent storage.
- Secondary memory is slower and cheaper than main memory, and it is usually not volatile.
- secondary memory’s large capacity can be provided to allow long term storage of programs and data, while a smaller main memory holds programs and data currently in use.
Virtual Memory
Virtual Memory refers to the concept whereby a process with a larger size than available memory can be loaded and executed by loading the process in parts. The program memory is divided into pages and the available physical memory into frames. The page size is always equal to the frame size. The page size is generally in a power of 2 to avoid the calculation involved to get the page number and the offset from the CPU generated address. The virtual address contains a page number and an offset. This is mapped to the physical address by a technique of address resolution after searching the Page Map Table.
Paging
In Virtual Memory Systems, a program in execution or a process is divided into equal sized logical blocks called pages that are loaded into frames in the main memory. The size of a page is always in a power of 2 and is equal to the frame size. Dividing the process into pages allows non-contiguous allocation in these systems.
Segmentation
Segmentation is a memory management technique that supports Virtual Memory. The available memory is divided into segments and consists of two components- a base address that denotes the address of the base of that segment and a displacement value that refers to the length of an address location from the base of that segment. The effective physical address is the sum of the base address value and the length of the displacement value.
Memory Location Policy
The relocation policy specifies the thresholds of the overall system-supported metrics as well as policy window which is the time window to be used for metric history collected by the WPAR Manager agent, and agent polling time which states how long the agent should wake up to analyze policy violations.
Location Of Outdoor System
The output from these devices is input for the computer. Similarly, printers and monitors take as input signals that a computer outputs. They then convert these signals into representations that human users can see or read. For a human user the process of reading or seeing these representations is receiving input. These interactions between computers and humans is studied in a field called human–computer interaction.
Relocation Of Paging System
If your PC's hard drive is divided into partitions, moving your paging file may enable you to achieve better system performance. The paging file is an area of your hard drive that Windows uses as RAM in what is called "virtual memory." Follow these steps to relocate the paging file to a different partition than the one containing your Windows system files.
Relocation of paging system - Least Recently Used (LRU), First In First Out (FIFO)
Least Recently Used (LRU):
- Removes page least recently accessed
- Efficiency
- Causes either decrease in or same number of interrupts
- Slightly better (compared to FIFO): 8/11 or 73%
- LRU is a stack algorithm removal policy
- Increasing main memory will cause either a decrease in or the same number of page interrupts
- Does not experience FIFO anomaly
Two variations:
- Clock replacement technique
- Paced according to the computer’s clock cycle
- Bit-shifting technique
- Uses 8-bit reference byte and bit-shifting technique
- Tracks usage of each page currently in memory
First In First Out (FIFO):
- Removes page in memory the longest
- Efficiency
- Ratio of page interrupts to page requests
- FIFO example: not so good
- Efficiency is 9/11 or 82%


No comments:
Post a Comment