100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Memory Management In Operating Systems $5.49   Add to cart

Class notes

Memory Management In Operating Systems

 3 views  0 purchase
  • Course
  • Institution

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-ordinatio...

[Show more]

Preview 3 out of 27  pages

  • December 30, 2022
  • 27
  • 2021/2022
  • Class notes
  • Ymk sir
  • All classes
avatar-seller
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

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller vaibhav51ppsv2020. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79202 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.49
  • (0)
  Add to cart