Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Memory Management In Operating Systems

Rating
-
Sold
-
Pages
27
Uploaded on
30-12-2022
Written in
2021/2022

In these notes, Covered all the topics of operating systems briefly. COs - Analyze the structure of OS and basic architectural components involved in OS design. Compare and contrast various CPU scheduling algorithms. Evaluate the requirements for the process synchronization and co-ordination in the contemporary operating system. Analyze various algorithms for memory management, I/O management and security aspects of operating system. Write shell scripts in Unix/Linux O.S and write simple programs using kernel system calls. Also understand virtualization concept

Show more Read less
Institution
Course

Content preview

5 – Memory Management

(1) Compare multiprogramming with fixed partition & multiprogramming with
variable partition with diagram. OR
Explain swapping in memory management.
Swapping
• In practice total amount of memory needed by all the processes is often much more
than the available memory.
• Swapping is used to deal with memory overhead.
• Swapping consists of bringing in each process in its entirety, running it for a while,
then putting it back on the disk.
• The event of copying process from hard disk to main memory is called as Swapped-
in.
• The event of copying process from main memory to hard disk is called as Swapped-
out.
• When swapping creates multiple holes in memory, it is possible to combine them all
into one big one by moving all the processes downward as far as possible. This
technique is called as memory compaction.
• Two ways to implement Swapping System
▪ Multiprogramming with Fixed partitions.
▪ Multiprogramming with dynamic partitions.
Multiprogramming with Fixed partitions
• This method allows multiple processes to execute simultaneously.
• Here memory is divided into fixed sized partitions. Size can be equal or unequal for
different partitions.
• Generally unequal partitions are used for better utilizations.
• Each partition can accommodate exactly one process, means only single process can
be placed in one partition.
• The partition boundaries are not movable.
• Whenever any program needs to be loaded in memory, a free partition big enough
to hold the program is found. This partition will be allocated to that program or
process.
• If there is no free partition available of required size, then the process needs to
wait. Such process will be put in a queue.
• There are two ways to maintain queue
▪ Using multiple Input Queues.
▪ Using single Input Queue.

1

, 5 – Memory Management
• The disadvantage of sorting the incoming jobs into separate queues becomes
apparent when the queue for a large partition is empty but the queue for a small
partition is full, as is the case for partitions 1 and 3 in Fig. 5-1(a).
• Here small jobs have to wait to get into memory, even though plenty of memory is
free. An alternative organization is to maintain a single queue as in Fig. 5-1(b).
Whenever a partition becomes free, the job closest to the front of the queue that
fits in it could be loaded into the empty partition and run.



Partition - 4 Partition - 4
Single
Partition - 3 Input Partition - 3
Multiple
Queue
Input
Queues

Partition - 2 Partition - 2


Partition - 1 Partition - 1
Operating
Operating
System
System

Figure 5-1. (a) Fixed memory partitions with separate input queues for each partition.
(b) Fixed memory partitions with a single input queue.


Multiprogramming with dynamic partitions
• This method also allows multiple processes to execute simultaneously.
• Here, memory is shared among operating system and various simultaneously
running processes.
• Memory is not divided into any fixed partitions. Also the number of partitions is not
fixed. Process is allocated exactly as much memory as it requires.
• Initially, the entire available memory is treated as a single free partition.
• Whenever any process enters in a system, a chunk of free memory big enough to fit
the process is found and allocated. The remaining unoccupied space is treated as
another free partition.
• If enough free memory is not available to fit the process, process needs to wait until
required memory becomes available.


2

, 5 – Memory Management
• Whenever any process gets terminate, it releases the space occupied. If the
released free space is contiguous to another free partition, both the free partitions
are merged together in to single free partition.
• Better utilization of memory than fixed sized size partition.
• This method suffers from External fragmentation.




Figure 5-2. Memory allocation changes as processes come into memory and leave it.
The shaded regions are unused memory.


(2) Explain memory management with Linked list and Bit maps.
• When memory is assigned dynamically, the operating system must manage it.
• In general there are two ways to keep track of memory usage.
▪ Memory Management with Bitmap.
▪ Memory Management with Linked List.
Memory Management with Bitmap
• With bitmap, memory is divided into allocation units.
• Corresponding to each allocation unit there is a bit in a bitmap.
• Bit is 0 if the unit is free.
• Bit is 1 if unit is occupied.
• The size of allocation unit is an important design issue, the smaller the size, the
larger the bitmap.
• The main problem is that when it has been decided to bring a k unit process, the
memory manager must search the bitmap to find a run of k consecutive 0 bits in the

3

Written for

Institution
Course

Document information

Uploaded on
December 30, 2022
Number of pages
27
Written in
2021/2022
Type
Class notes
Professor(s)
Ymk sir
Contains
All classes

Subjects

$5.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
vaibhav51ppsv2020

Also available in package deal

Get to know the seller

Seller avatar
vaibhav51ppsv2020 C.K.Pithawala school of engineering and techonology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
14
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions