0% found this document useful (0 votes)
6 views

Assignment 4

The document discusses memory management techniques in operating systems, focusing on simple paging and virtual memory paging, which allow for efficient use of memory by managing non-contiguous addresses. It also explains the concepts of pages and frames, as well as resident set management and page replacement policies, highlighting their importance in virtual memory systems. Additionally, it describes the Buddy System for memory allocation, detailing the process of allocating and deallocating memory blocks to optimize utilization and reduce fragmentation.

Uploaded by

varneetmaan28
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Assignment 4

The document discusses memory management techniques in operating systems, focusing on simple paging and virtual memory paging, which allow for efficient use of memory by managing non-contiguous addresses. It also explains the concepts of pages and frames, as well as resident set management and page replacement policies, highlighting their importance in virtual memory systems. Additionally, it describes the Buddy System for memory allocation, detailing the process of allocating and deallocating memory blocks to optimize utilization and reduce fragmentation.

Uploaded by

varneetmaan28
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

ASSIGNMENT 4

VARNEET
OPERATING SYSTEMS

ANSWER 1. Simple paging along with virtual memory paging both include breaking
memory into set-sized sections, regardless their numerous applications and operating
methods. Simple paging serves as a memory management method in which demands
can be given non-contiguous memory addresses to avoid splitting by using fixed-sized
pages from physical memory. Conversely, virtual memory paging transcends this
concept by combining hardware and software to produce the illusion of a larger address
space than is actually present. This allows programs to effectively parallelism and
process separation by using more memory than is physically accessible by swapping
pages in and out of disk storage as needed.

ANSWER 2. Despite the fact that they refer to distinct features, a page and a frame
have similarities ideas in memory management. A page is a fixed-sized data block
stored in the virtual memory space of a system. It speaks to a physical data unit that
could take residence in memory. In comparison, a frame in RAM is a fixed-sized piece of
physical memory. The operating system transforms pages to frames whenever an app
wants to have access to data, so transforming digital addresses actual real addresses.
Pages thus remain in virtual storage; frames are physical memory location where the
pages are maintained during usage.

ANSWER 3. While they serve various objectives, resident set management and page
replacement policy constitute extremely essential elements of virtual memory systems.
Resident set control over the amount of frames a process receives as well as which
pages—the local setup—are kept in physical memory. To ensure the optimal potential
speed, users must pick and choose on the quantity and type of RAM pages to be
utilized. If a page fault occurs, on the opposite hand, a page replacement policy kicks in
to indicate that the desired page is not stored in physical memory. The policy indicates
which sections from physical memory should be removed to provide sufficient room for
the extra page. Common page replacement principles demand for Optimal Page
Replacement, First-In- First-Out (FIFO), and the least Recently Used (LRU).

ANSWER 4. Here is how you use the Buddy System to allocate memory:

Define the total amount of available RAM when initializing the memory pool.
Need to Allocate Memory: Please provide the required memory block size.
Locate the Appropriate Block: Try to find the smallest available block that fits the size
you've specified.
If the smallest block is excessively big, you can divide it into smaller ones.
Confirm the Block's Allocation: Put the block into use after you've allocated it.
We can see this in action by looking at an example.

Instance RAM Size: 1024 KB

Requests for Memory:

Set aside 100 KB.


Set aside 300 KB, 200 KB, 100 KB free, and 50 KB.
Allocation Process Step by Step:
Set up the Memory Pool from scratch:

Total RAM = 1024 kilobytes


Number of Blocks Available: [1024 KB]
We need 100 KB.

Minimalist building block design: Divide 1024 KB by 512 KB, then divide 512 KB by 256
KB, and so on.
Dividing 256 KB into 128 KB and 64 KB is an example of this.
Set aside a 128 KB chunk
These are the blocks that are currently available: [512 KB, 256 KB, 128 KB, 64 KB, 64
KB]
A 300 KB request:

Minimum usable block size: 512 KB


Distribute one 512 KB block; divide 512 KB into two parts of 256 KB each.
The blocks that are available are as follows: [64 KB, 64 KB, 128 KB, 128 KB, 256 KB]
A 200 KB request:

Minimum usable block size: 256 KB


Set aside a single 256 KB chunk.
There are 256 KB, 128 KB, 64 KB, and 64 KB blocks available.
Get 100 KB for free:

Release the previously allotted 128 KB block.


Combine any available free blocks, but don't do it here.
Levels of Blocks: file sizes: [256 KB, 128 KB, 128 KB, 64 KB, 64 KB]
I need 50 KB.

Minimum usable block size: 64 KB


Set aside a 64 KB chunk
File Sizes: [256 KB, 128 KB, 128 KB, 64 KB] The available blocks are:
The Current Situation:
Volumes allotted: [128 KB for 100 KB requests, 512 KB for 300 KB requests, 256 KB for
200 KB requests, 64 KB for 50 KB requests]
File Sizes: [256 KB, 128 KB, 128 KB, 64 KB] The available blocks are:
Through dynamic block splitting and merging, the Buddy System aids in efficient
memory allocation and deallocation, improving memory utilization and reducing
fragmentation.

REFRENCES:

1. Silberschatz, A., Galvin, P. B., & Gagne, G. (2020). Operating system concepts
(10th ed.). Wiley.
2. Stallings, W. (2018). Operating systems: Internals and design principles (9th ed.).
Pearson.
3. Tanenbaum, A. S., & Bos, H. (2015). Modern operating systems (4th ed.).
Pearson.

You might also like