0% found this document useful (0 votes)
2 views4 pages

Ali Raza Assignment

The document discusses memory management in operating systems, highlighting its importance in allocating memory, avoiding waste, and improving performance. It outlines main techniques such as contiguous memory allocation, paging, segmentation, virtual memory, and swapping, detailing their advantages and disadvantages. The conclusion emphasizes the necessity of efficient memory use for stable and fast system performance.
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)
2 views4 pages

Ali Raza Assignment

The document discusses memory management in operating systems, highlighting its importance in allocating memory, avoiding waste, and improving performance. It outlines main techniques such as contiguous memory allocation, paging, segmentation, virtual memory, and swapping, detailing their advantages and disadvantages. The conclusion emphasizes the necessity of efficient memory use for stable and fast system performance.
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

ASSIGNMENT

Operating System
Submitted to:

Mr. Abdul Basit

Submitted by:

Ali Raza

Section:

Roll Number:

167

Department of Computer Science

MNS University of Engineering and Technology, Multan


What is Memory Management?
Memory Management is a function of the operating system
that handles and manages computer memory. It keeps track of
each byte in a computer’s memory and makes sure the
memory is used efficiently.
Why is Memory Management Important?
To allocate memory to different programs
To avoid memory waste
To protect memory space of one program from another
To improve performance
Main Memory Management Techniques
Contiguous Memory Allocation
Paging
Segmentation
Virtual Memory
Swapping
1. Contiguous Memory Allocation
Memory is divided into fixed-sized or variable-sized
partitions.
Each process is loaded into a single contiguous block of
memory.
Types:
Single Partition: Whole memory is given to one process.
Multiple Partition: Memory is divided into many parts; each
part holds one process.
Problem: Leads to external fragmentation (small empty spaces
between allocated memory blocks).
2. Paging
Memory is divided into small fixed-size blocks called pages.
The physical memory is also divided into blocks called
frames.
Pages of a process can be loaded into any frame (not
necessarily together).
Advantages:
Solves external fragmentation
Efficient memory use
Disadvantage:
Slightly more complex to manage
3. Segmentation
Memory is divided based on logical divisions of a program
like code, data, stack, etc.
Each segment has a name and a length.
Example Segments:
Code segment
Data segment
Stack segment
Advantage: Makes program easier to manage and debug
Disadvantage: Can cause external fragmentation
4. Virtual Memory
It allows execution of processes that may not be completely in
memory.
Uses both RAM and Hard Disk.
Part of the program is kept in memory; the rest is kept on disk
and loaded when needed.
Technique used: Demand Paging
Advantage: Allows large programs to run
Disadvantage: Slower than using only RAM
5. Swapping
A process is swapped from main memory to disk and brought
back later.
Helps manage memory when many processes are running.
Advantage: Increases multiprogramming
Disadvantage: Time-consuming (slow)
Conclusion:
Memory management ensures that:
Memory is used efficiently.
Programs run without interfering with each other.
The system remains stable and fast.

You might also like