Vous êtes sur la page 1sur 16

TERM PAPER

OPERATING SYSTEM

TOPIC

STRATERGIES OF MEMORY

MEMORY

Memory is the central to the operation of computer systems. Memory consists of large array of words or bytes, each with its own address. Main memory is a repository of quickly accessible data shared by the CPU and I/O devices. The main memory is generally the only large storage device that the CPU is able to address and access directly.

For a program to be executed, it must be mapped to absolute address and loaded to memory. Instructions must be in memory for the CPU to execute them and also for the CPU to process data from disk; those data must first be transferred to main memory for CPU to execute them. As the program executes, it access program instructions and data from memory by generating absolute addresses. Once the program is terminated, its memory space is declared available and next program can be loaded and executed.

MEMORY MANAGEMENT

Memory management is the process of managing computer memory. To improve both the utilization of the CPU and the speed of the computers response to its user, general-purpose computers must keep several programs in memory, creating a need for memory management.

MEMORY MANAGEMENT STATERGIES

The different memory management strategies are as follows:Swapping Contiguous memory allocation Paging Segmentation

SWAPPING

Swapping is the procedure in which a process is swapped out temporarily of the memory to a backing store and then again brought back into memory for further execution. The backing storage is generally a disk.
A variant of swapping is sometimes called roll out, roll in. This variant is used for priority-based scheduling algorithms. Swapping is constrained by other factors as well. If we want to swap a process, we must be sure that the process is idle completely. If a process is waiting for an I/O operation or accessing the main memory it cannot be swapped out of the memory.

CONTIGUOUS MEMORY ALLOCATION

Contiguous memory allocation is one of the oldest memory allocation schemes. When a process needs to execute, memory is requested by the process. The size of the process is compared with the amount of contiguous main memory available to execute the process. If sufficient contiguous memory is found the process is allocated memory to start its execution. Otherwise, it is added to the waiting queue until sufficient contiguous memory is available.

In contiguous memory allocation, each process is contained in a single contiguous section of memory.

One of the simplest methods of allocating memory is to divide the memory into several fixed size partitions. Each partition contains exactly one process. When a partition is free, a process is selected from the waiting queue and is allocated that free partition. When the process terminates, that partition becomes available for other processes.

PAGING

Paging is a memory management technique in which the memory is divided into fixed size pages. Paging is used for faster access to data. Paging avoids the considerable problem of fitting memory chunks of varying sizes onto backing store; most memory-management schemes used. The basic method for implementing paging involves breaking physical memory into fixed-sized blocks called frames and breaking logical memory into blocks of same size called pages

SEGMENTATION

Segmentation is one of the most common ways to achieve memory protection. In a computer system using segmentation, an instruction operand that refers to a memory location includes a value that identifies a segment and an offset within that segment. A segment has a set of permissions, and a length, associated with it.

In addition to the set of permissions and length, a segment also has associated with it information indicating where the segment is located in memory. It may also have a flag indicating whether the segment is present in main memory or not; if the segment is not present in main memory, an exception is raised, and the operating system will read the segment into memory from secondary storage.

THANK YOU

Vous aimerez peut-être aussi