0% found this document useful (0 votes)
66 views9 pages

Activity No. 4 Memory Management

The document describes four C programming activities to simulate different memory management techniques: MFT, MVT, worst-fit, best-fit, and first-fit. For each activity, students are to write a C program to simulate the technique, output and discuss the results, and reflect on their learning. The techniques allocate memory to processes differently, with MFT using fixed partitions, MVT using dynamic partitions, and the contiguous methods choosing the best, first, or worst fitting free block on arrival of a new process.

Uploaded by

Ash Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views9 pages

Activity No. 4 Memory Management

The document describes four C programming activities to simulate different memory management techniques: MFT, MVT, worst-fit, best-fit, and first-fit. For each activity, students are to write a C program to simulate the technique, output and discuss the results, and reflect on their learning. The techniques allocate memory to processes differently, with MFT using fixed partitions, MVT using dynamic partitions, and the contiguous methods choosing the best, first, or worst fitting free block on arrival of a new process.

Uploaded by

Ash Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Name:

Course

Activity No. 4 C Programming: Memory Management


OBJECTIVE
Write a C program to simulate the MVT and MFT memory management techniques
DESCRIPTION
MFT (Multiprogramming with a Fixed number of Tasks) is one of the old memory management
techniques in which the memory is partitioned into fixed size partitions and each job is assigned
to a partition. The memory assigned to a partition does not change. MVT (Multiprogramming
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.
PROGRAM
Sample Output:

Discussion of Results:

Reflection:
PROGRAM 2

Sample Output:

Discussion of Results:

Reflection:
OBJECTIVE
Write a C program to simulate the following contiguous memory allocation techniques
a) Worst-fit b) Best-fit c) First-fit
DESCRIPTION
One of the simplest methods for memory allocation is to divide memory into several
fixed-sized partitions. Each partition may contain exactly one process. In this multiple-partition
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. The operating system keeps a table indicating which parts of memory are available and
which are occupied. Finally, when a process arrives and needs memory, a memory section large
enough for this process is provided. When it is time to load or swap a process into main
memory, and if there is more than one free block of memory of sufficient size, then the
operating system must decide which free block to allocate. Best-fit strategy chooses the block
that is closest in size to the request. First-fit chooses the first available block that is large
enough. Worst-fit chooses the largest available block.
PROGRAM
Sample Output:

Discussion of Results:

Reflection:
PROGRAM
Sample Output:

Discussion of Results:

Reflection:

PROGRAM
Sample Output:

Discussion of Results:

Reflection:

You might also like