πŸŽ“ Computer Science & Engineering Portal

Master Engineering Disciplines with Structured Notes

Comprehensive academic lecture notes, exam-oriented unit summaries, laboratory manuals, and previous year question papers designed strictly for university students.

πŸ“‘

University Syllabi

AKTU & AICTE aligned semester guidelines.

πŸ“

Exam Question Papers

Previous 5 years solved university papers.

πŸ’‘

Lab Manuals & Viva

Practical codes with outputs & interview Qs.

Core Subjects & Units Hub

Click on any specific unit to immediately view its lecture notes below

Viewing All Lectures

Compaction

Compaction

As we know, fixed and dynamic partitioning suffers from external fragmentation. However, this issue can overcome through Compaction.

In compaction, all the holes are made contiguous and all the loaded processes in different partitions are brought together  by OS. 

Now merged holes can accommodate new processes according to their needs. This method is also known as de-fragmentation. Let us explain through diagram

compaction

After compaction the process P8 can be loaded into main memory easily because contiguous space is available now.

Problems with Compaction

Efficiency of the system also decrease because CPU set idle at the time of compaction.

Explanation: At the time of compaction, CPU stops execution of current process because it will resume the process from somewhere else after compaction. If CPU does not stop the execution of a process then it may execute the instructions from somewhere else locations instead of next instruction of same process in memory.

Note: Consider an OS require 6 NS time to transfer 1-B then, 1 MB transfer needs (1 X 2^20) X (6 X 10 ^ -9) seconds.

So, large the amount of data to transfer, require a huge amount of time.

1. Complex Memory Allocation

In Fixed partitioning, the list of partitions is made once and will never change.

As allocation and de-allocation takes place very frequently in dynamic memory allocation. So, partition size also change each time in allocation and de-allocation. That’s why, it is very difficult for OS to manage everything at a time.

How to manage allocation and de-allocation?

OS use the following data structures for memory allocation and de-allocation.

  • Bit Map
  • Linked List

Both of these concepts, we will discuss in the next post.


Labels: ,

Discussion & Queries (<$I18NNumComments$>):

<$CommentPager$>
<$I18NAtCommentTimeWithPermalink$>, <$I18NCommentAuthorSaid$>

<$BlogCommentBody$>

<$BlogCommentDeleteIcon$>
<$CommentPager$>