0% found this document useful (0 votes)
19 views3 pages

Memory Management Techniques

The document outlines two multi-programming methods: Fixed Number of Tasks (MFT) and Variable Number of Tasks (MVT). MFT involves partitioning memory into fixed sizes for task allocation, while MVT allows dynamic memory allocation based on process requirements. Both methods detail processes for task arrival, execution, completion, and memory management.

Uploaded by

letrutia1433
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)
19 views3 pages

Memory Management Techniques

The document outlines two multi-programming methods: Fixed Number of Tasks (MFT) and Variable Number of Tasks (MVT). MFT involves partitioning memory into fixed sizes for task allocation, while MVT allows dynamic memory allocation based on process requirements. Both methods detail processes for task arrival, execution, completion, and memory management.

Uploaded by

letrutia1433
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/ 3

A) Multi-programming with Fixed Number of Tasks

(MFT):

1. Partition Initialization:
- Divide the memory into k fixed-sized partitions.
- Each partition should be large enough to hold one process.
- Initialize a list of partitions, marking all as empty.

2. Task Arrival and Allocation:


- When a new process Pi arrives:
- Check the list of partitions for an empty one.
- If an empty partition (Pj) is found:
- Allocate Pi to partition Pj.
- Mark partition Pj as occupied by Pi.
- If no empty partition is found:
- Place Pi in a waiting queue.

3. Task Execution:
- Run each process concurrently in its allocated partition.
- Processes execute independently, unaware of each other's existence.

4. Task Completion and Partition Release:


- When a process Pi finishes execution:
- Mark its partition as empty.
- Release the partition for reuse by other processes.

5. Repeat:
- Go back to step 2 and continue allocating partitions to incoming processes.
B) Multi-programming with Variable Number of Tasks
(MVT):

1. Memory Initialization:
- Start with the entire memory pool available for allocation.
- Initialize a list of free memory blocks representing available space.

2. Task Arrival and Memory Allocation:


- When a new process Pi arrives:
- Determine its memory requirements (Mi).
- Search the list of free memory blocks for a block large enough to
accommodate Pi.

3. Memory Allocation Decision:


- If a suitable memory block is found:
- Allocate it to Pi.
- Split the block if necessary, creating a new block for the remainder of free
space.
- If no single block is large enough:
- Use memory allocation algorithms to find the best-suited block.
- This may involve merging or splitting existing blocks to fulfil Pi's
requirements.

4. Task Execution:
- Execute each process in its allocated memory block.
- Processes run independently within their allocated memory space.

5. Task Completion and Memory Reclamation:


- When a process Pi completes execution:
- Mark its memory block as free.
- Merge adjacent free blocks, if possible, to prevent fragmentation.

6. Repeat:
- Return to step 2 to handle incoming processes and manage memory
allocation dynamically.

You might also like