Chapter 2: Memory management
Introduction:
The memory management is related with the management of primary memory. The primary memory means memory that the processor directly access for instruction and data. Primary memory is frequently called as ‘Core’ memory.
Specially memory management is concern with four functions..
1) Keeping track of status of memory.
2) Determining allocation policy for memory.
3) Allocate resources.
4) De-allocate resources.
The memory management policies are chosen in such a way that these memory management modules should be small, simple & at the same time flexible also.
Following techniques are used for memory management……
1) Single Contagious memory management.
2) Partitioned memory management.
3) Relocation Partitioned memory management.
4) Paged memory management.
5) Demand paged memory management.
6) Segmented memory management.
7) Segmented & Demand paged memory management.
8) Other memory management schemes.
1. Single Contagious memory management:
It is the simple memory management scheme that requires no special hardware features. It is usually associated with small stand alone computers with simple batch operating system. In such system there is no multi programming and one to one correspondence exists between user, a job, a job step and a process.
O.S |
|
Actually used by Job |
|
Allocated but unused (wasted) |
|
Fig: Single Contagious memory management
Single Contagious memory management is conceptually divided into regions. A portion of memory management is permanently allocated to operating system. All the reminder of memory is available to single job being processed. The job actually uses only a portion of the allocated memory, leaving an allocated but unused region of memory.
Example: - If there are 256k bytes of memory, a simple operating system may require 32k bytes leaving 224k bytes allocated for users job. If a typical job requires only64k bytes, then 160k bytes of memory are unused. This unused memory cannot necessarily be to the manufacturer or owner.
The main advantages of this scheme are …..
a) Keeping track of memory – It is allocated entirely to one job.
b) Determining factor on memory policy – The job gets all memory when scheduled.
c) Allocation of memory – All of it is allocated to job.
d) De-allocation of memory – When the job is done, all memory is returned to free status.
Hardware Support:-
No special hardware is required for the contagious allocation. But, sometime primitive hardware protection mechanism is needed to ensure that the user program do not accidentally or intentionally tampers with operating system. This mechanism may consist of bound register contains the address of the protected area.
If CPU is in user mode then user can not access the protected area; even if he tries to access, then all the control is transferred to the operating system.
If CPU is in supervised mode then user can access the protected area as well as execute privileged instructions that can change the content of bound register.
Software Support:-
|
Advantages:-
1. Simplicity in operation.
2. It does not require great expertise to understand.
Disadvantages:-
1. Poor utilization of memory.
2. Poor utilization of processor.
3. Users job being limited to size of available main memory.