Memory Allocation

Only available on StudyMode
  • Download(s) : 82
  • Published : February 26, 2011
Open Document
Text Preview
Memory Allocation

Now we will discuss about the various memory allocation schemes.

Single Partition Allocation

In this scheme Operating system is residing in low memory and user processes are executing in higher memory.

* It is simple.
* It is easy to understand and use.
* It leads to poor utilization of processor and memory.
* Users job is limited to the size of available memory.

Multiple-partition Allocation

One of the simplest methods for allocating memory is to divide memory into several fixed sized partitions. There are two variations of this. * Fixed Equal-size Partitions
It divides the main memory into equal number of fixed sized partitions, operating system occupies some fixed portion and remaining portion of main memory is available for user processes.

* Any process whose size is less than or equal to the partition size can be loaded into any available partition. * It supports multiprogramming.

* If a program is too big to fit into a partition use overlay technique. * Memory use is inefficient, i.e., block of data loaded into memory may be smaller than the partition. It is known as internal fragmentation. * Fixed Variable Size Partitions

By using fixed variable size partitions we can overcome the disadvantages present in fixed equal size partitioning. This is

shown in the figure below:

With unequal-size partitions, there are two ways to assign processes to partitions. * Use multiple queues:- For each and every process one queue is present, as shown in the figure below. Assign each process to the smallest partition within which it will fit, by using the scheduling queues, i.e., when a new process is to arrive it will put in the queue it is able to fit without wasting the memory space, irrespective of other blocks queues.

* Minimize wastage of memory.

* This scheme is optimum from the system point of view. Because larger partitions remains unused. * Use single queue:- In this method only one ready queue is present for scheduling the jobs for all the blocks irrespective of size. If any block is free even though it is larger than the process, it will simply join instead of waiting for the suitable block size.It is depicted in the figure below:

* It is simple and minimum processing overhead.

* The number of partitions specified at the time of system generation limits the number of active processes. * Small jobs do not use partition space efficiently.

Dynamic Partitioning

Even though when we overcome some of the difficulties in variable sized fixed partitioning, dynamic partitioning require more sophisticated memory management techniques. The partitions used are of variable length. That is when a process is brought into main memory, it allocates exactly as much memory as it requires. Each partition may contain exactly one process. Thus the degree of multiprogramming is bound by the number of partitions. In this method when a partition is free a process is selected from the input queue and is loaded into the free partition. When the process terminates the partition becomes available for another process. This method was used by IBM's mainframe operating system, OS/MVT (Multiprogramming with variable number of tasks) and it is no longer in use now.

Let us consider the following scenario:
Process|Size (in kB)|Arrival time (in milli sec)|Service time (in milli sec) -------------------------------------------------
P1 |350 |0|40
P2 |400 |10|45
P3 |300 |30|35...
tracking img