[go: up one dir, main page]

0% found this document useful (0 votes)
43 views10 pages

Memory Management Report

Uploaded by

sumitdhakar956
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)
43 views10 pages

Memory Management Report

Uploaded by

sumitdhakar956
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
You are on page 1/ 10

A REPORT

On

MEMORY MANAGEMENT SYSTEM

Submitted in partial fulfilment of the requirements of the degree of

BACHELOR OF TECHNOLOGY

in

COMPUTER SCIENCE AND ENGINEERING

Submitted by: Submitted To:

Lovelesh Gupta Suraj Sharma

BETN1DS23025 Asst. Prof. Of DSA,Soet

Content
Abstract

List of Tables

Chapter 1 Introduction & Objectibles

1.1 Introduction

1.2 Objective

2 Literature Survey

2.1 Types of Memory

2.2 Virtual Memory

Chapter 3 Policies and Challanges

Project Detail

Chapter 4

Results and discussions

Chapter 5 Conclusions and future work

References

Abstract

A Memory Management System (MMS) is a critical component of any


operating system (OS), responsible for managing the computer's memory
resources efficiently and ensuring that programs have the necessary
memory for execution. The primary objective of an MMS is to allocate and
deallocate memory to processes, while minimizing fragmentation and
ensuring optimal system performance. It involves various techniques,
including paging, segmentation, and virtual memory, to handle both physical
and virtual memory spaces. Paging divides memory into fixed-size blocks
(pages) to enable efficient memory usage, while segmentation divides
memory into variable-sized segments that match the logical structure of
programs. Virtual memory extends the concept of physical memory by
allowing processes to use more memory than is physically available, relying
on secondary storage to swap data in and out.

Memory management also ensures protection and isolation between


processes, preventing them from accessing each other's memory space,
thereby enhancing system security and stability. Furthermore, modern
operating systems employ algorithms for memory allocation, such as First
Fit, Best Fit, and Worst Fit, which optimize memory usage based on system
requirements. Effective memory management is vital for system
performance, especially in multi-tasking and multi-user environments, where
efficient handling of memory resources reduces overhead and improves
response times. As software and hardware continue to evolve, the design of
advanced memory management systems that can address growing demands
for efficiency, scalability, and security becomes increasingly important.
Chapter 1 – Introduction and Objectibles

1. Introduction to Memory Management

Memory management is a critical component of an operating system that


involves managing the computer's memory resources. It is responsible for
efficiently allocating and deallocating memory to various programs and
processes running on the system. The goal of memory management is to
ensure that each program gets the required memory space without
interfering with others, and that memory is utilized optimally.
3. Objectives of Memory Management

The primary objectives of memory management are:

 Efficient Memory Utilization: Maximize the use of available memory


resources.
 Process Isolation: Ensure that one process does not interfere with
another by providing each process with its own address space.
 Security and Protection: Protect data from unauthorized access by
managing memory access rights.
 Easy Allocation and Deallocation: Efficiently allocate and
deallocate memory space for processes without fragmentation.
 Support for Multitasking: Allow multiple processes to run
concurrently by managing memory allocation for each process.

Chapter 2 – Types of Memory

Contiguous Memory Allocation

In contiguous memory allocation, each process is allocated a single


contiguous block of memory. This is a simple and efficient method, but it
leads to fragmentation, as free memory is scattered over time.

 Advantages:
o Simple to implement.
o Low overhead.
 Disadvantages:
o External fragmentation (unused space between allocated
blocks).
o Fixed size for each process, which can lead to inefficient use of
memory.

Paged Memory Allocation

Paged memory allocation divides the physical memory into small fixed-size
blocks called pages. The logical memory (processes) is divided into blocks of
the same size, called pages. This allows non-contiguous memory allocation,
which helps reduce fragmentation.

 Advantages:
o Eliminates external fragmentation.
o Efficient use of memory.
 Disadvantages:
o Overhead of managing page tables.
o Potential internal fragmentation (unused space in pages).

Segmented Memory Allocation

In segmented memory allocation, memory is divided into segments of


varying sizes based on logical divisions like functions, arrays, and data. Each
segment is allocated a contiguous block of memory.

 Advantages:
o Allows dynamic size allocation.
o More logical than paging for complex data structures.
 Disadvantages:
o External fragmentation can occur.
o Complex to manage and requires maintaining multiple segment
tables.

2.2 Virtual Memory

Virtual memory allows the system to use secondary storage (such as a hard
drive or SSD) as an extension of RAM. This creates the illusion that the
system has more memory than it physically does. Virtual memory is
managed through paging and segmentation.

 Advantages:
o Allows larger applications to run than the physical memory would
permit.
o Isolates process memory spaces.
 Disadvantages:
o Slower than physical memory, as accessing secondary storage is
much slower than RAM.

Chapter 3 – Policies and Challanges

3.1. Memory Management Policies


Memory management policies help determine how memory is allocated and
deallocated. Some common policies include:

5.1. First-Fit Allocation

The first-fit allocation policy allocates the first available block of memory that
is large enough to accommodate the process. This approach is efficient in
terms of speed but can lead to fragmentation over time.

5.2. Best-Fit Allocation

Best-fit allocates the smallest available block that fits the process,
minimizing wasted space. However, this can lead to many small leftover
holes, increasing fragmentation in the long term.

5.3. Worst-Fit Allocation

Worst-fit allocates the largest available block of memory to a process. While


this may reduce fragmentation, it can lead to inefficient memory utilization
as large blocks of memory might not always be needed.

5.4. Buddy System

The buddy system divides memory into blocks that are powers of two. When
a process requests memory, the system finds the smallest available block
that fits, and if necessary, splits a larger block into smaller "buddies" of equal
size.

3.2 Challenges in Memory Management

Memory management faces several challenges, such as:

 Fragmentation: Over time, memory can become fragmented,


meaning free space is scattered and inefficient.
o External Fragmentation: Occurs when free memory is
scattered in small blocks.
o Internal Fragmentation: Occurs when allocated memory
blocks are not fully used.
 Thrashing: A situation in virtual memory management when the
system spends more time swapping data between RAM and secondary
storage than executing processes. It occurs when there is not enough
physical memory to support the running processes.
 Memory Leaks: Occur when a process fails to release memory that is
no longer needed, leading to a gradual loss of available memory.
 Concurrency and Synchronization: When multiple processes need
memory at the same time, ensuring safe and efficient allocation
requires careful synchronization mechanisms.

7. Modern Memory Management Techniques

Modern operating systems have evolved to tackle the above challenges


using more sophisticated techniques:

 Demand Paging: Pages are only loaded into memory when required,
reducing memory usage.
 Memory Overcommitment: Systems like Linux use overcommit
policies, allowing more memory to be allocated than physically
available, relying on swapping or killing processes when memory runs
low.
 NUMA (Non-Uniform Memory Access): A memory design where
processors have local memory but can also access memory from other
processors. Modern operating systems optimize memory allocation in
NUMA systems to reduce access time.
Chapter 4 – Results and Future Work
8. Conclusion

Memory management is a fundamental aspect of an operating system that


ensures efficient use of the system's memory resources. By using techniques
such as paging, segmentation, and virtual memory, modern operating
systems can provide multitasking capabilities, protect memory, and improve
performance. However, challenges like fragmentation, memory leaks, and
thrashing remain areas of active research and optimization.

As technology advances, memory management systems are continually


evolving to address new challenges, such as supporting larger datasets,
optimizing performance in multi-core environments, and minimizing power
consumption in mobile devices.

9. References

 Silberschatz, A., Galvin, P. B., & Gagne, G. (2018). Operating System


Concepts (9th ed.). Wiley.
 Tanenbaum, A. S., & Bos, H. (2015). Modern Operating Systems (4th
ed.). Pearson Education.
 Stallings, W. (2014). Operating Systems: Internals and Design
Principles (8th ed.). Pearson.

You might also like