SHRI RAMSWAROOP
MEMORIAL UNIVERSITY
Deva Road Lucknow
Name : Ashwani Kumar Singh
Course: MCA Sem: 2nd Sem
Roll No: 202310101050073
Subject: Operating System
Sumitted To: Jullius Sir
TOPIC
MEMORY MANAGEMENT
Memory management is a crucial aspect of computer
systems that involves allocating and managing memory
resources efficiently. It is essential for ensuring that
programs and processes can run smoothly without
running out of memory or causing conflicts.
Types of Memory Management
Memory management can be categorized into several types
based on different approaches and techniques employed to
handle memory allocation, deallocation, and utilization. Some
of the common types of memory management include:
1.Manual Memory Management: In this approach, memory
allocation and deallocation are explicitly handled by the
programmer. Programmers are responsible for allocating
memory when needed and deallocating it when it's no longer
required. This approach requires careful management to
avoid memory leaks and dangling pointers.
2.Automatic Memory Management: Also known as garbage
collection, this approach delegates memory management tasks to
the runtime environment or programming language. Garbage
collection automatically identifies and deallocates memory that is
no longer in use, relieving programmers from manual memory
management tasks and reducing the risk of memory leaks.
3.Static Memory Management: Static memory management
involves allocating memory at compile time. Memory allocation is
determined before the program starts executing, and the size and
location of memory blocks are fixed throughout the program's
execution. Static memory management is commonly used for
global variables and data structures with fixed sizes.
4.Dynamic Memory Management: Dynamic memory management
allows memory allocation and deallocation to occur at runtime.
Memory is allocated as needed and can be resized or deallocated
dynamically during program execution. Dynamic memory
management provides flexibility but requires careful handling to
prevent memory leaks and fragmentation.
5.Stack-based Memory Management: Stack-based memory
management allocates memory for local variables and function
parameters on the stack. Memory allocation and deallocation are
automatic and follow a last-in-first-out (LIFO) order. Stack-based
memory management is efficient but has limited flexibility and may
impose size restrictions on memory allocations.
8.Memory Pooling: Memory pooling involves preallocating a fixed-
size block of memory and managing it as a pool of memory blocks.
Memory pooling reduces memory fragmentation and overhead
associated with dynamic memory allocation by reusing memory
blocks for similar-sized allocations.
6.Heap-based Memory Management: Heap-based memory
management involves allocating memory from a dynamically
managed heap. Memory allocations on the heap are typically
larger and can have variable lifetimes. Heap-based memory
management offers greater flexibility but requires explicit
memory allocation and deallocation by the programmer.
7.Virtual Memory Management: Virtual memory management
involves the use of virtual memory to provide an illusion of a
larger memory space than physically available. It allows
programs to use more memory than is physically installed on
the system by temporarily storing data on disk storage. Virtual
memory management techniques include paging, swapping,
and demand paging.
Memory Management in operating system
Thank You