Professional Documents
Culture Documents
Ex 8
Ex 8
Experiment:3.1
Aim: Write a Program to simulate the MVT
Software Required: VS Code, C++ compiler
Description: MVT (Multi programming with a Variable number of Tasks) is the memory
management technique in which each job gets just the amount of memory it needs. That is, the
partitioning of memory is dynamic and changes as jobs enter and leave the system. MVT is a
more ``efficient'' user of resources. MFT suffers with the problem of internal fragmentation
and MVT suffers with external fragmentation.
Pseudo code/Algorithms/Flowchart/Steps:
Step1: Start the process.
Ms=ms+os
Step 7: If the process size is less than partition size alloys also block the process. While
allocating update memory wastage-external fragmentation.
Step 9: Stop
Implementation:
#include <iostream>
#include <cstdio>
#include <cstdlib>
int main()
{ int m = 0, m1 = 0, m2 = 0, p, count = 0, i;
cout << "Enter the memory capacity: "; cin
>> m; cout << "Enter the number of
processes: "; cin >> p;
int arr[p]={0};
cout<<"process\t"<<"memory allocated"<<endl;
for(i=0;i<p;i++){
cout<<i+1<<"\t"<<arr[i]<<endl;
} return
0;
}
Output: