Memory Management in OS

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 33

Logical and Physical Address Spaces

A logical address space is the set of all addresses that a process can use to
access memory. Logical addresses are virtual addresses, and they are mapped to
physical addresses by the memory management system. The physical address
space is the set of all addresses that correspond to physical memory locations.
Memory Fragmentation
Memory fragmentation refers to the inefficiencies in memory utilization that can occur
over time. There are two types of memory fragmentation:

4.5.1 External Fragmentation

External fragmentation occurs when free memory is divided into small, non-contiguous
blocks that cannot be used to accommodate a process even if the total free memory is
sufficient. It reduces the overall memory utilization. Techniques such as compaction
(moving processes in memory to create larger contiguous blocks of free memory) or
paging can be used to mitigate external fragmentation.
4.5.2 Internal Fragmentation

Internal fragmentation occurs when memory is allocated in fixed-sized


blocks, and the allocated block is larger than the actual memory
requirement of the process. The unused portion of the allocated block
creates wasted memory space. Techniques such as segmentation or
dynamic memory allocation algorithms can help reduce internal
fragmentation.
S.NO Internal fragmentation External fragmentation

In internal fragmentation fixed-sized memory, In external fragmentation, variable-sized memory blocks


1. blocks square measure appointed to process. square measure appointed to the method.

Internal fragmentation happens when the External fragmentation happens when the method or
2. method or process is smaller than the memory. process is removed.

The solution of internal fragmentation is the The solution to external fragmentation is compaction and
3. best-fit block. paging.

Internal fragmentation occurs when memory is External fragmentation occurs when memory is divided
4. divided into fixed-sized partitions. into variable size partitions based on the size of processes.

The difference between memory allocated and The unused spaces formed between
5. required space or memory is called Internal non-contiguous memory fragments are too small to serve
fragmentation. a new process, which is called External fragmentation.

Internal fragmentation occurs with paging and External fragmentation occurs with segmentation and
6. fixed partitioning. dynamic partitioning.

It occurs on the allocation of a process to a It occurs on the allocation of a process to a partition


partition greater than the process’s requirement.
7. The leftover space causes degradation system
greater which is exactly the same memory space as it is
required.
performance.

8. It occurs in worst fit memory allocation method. It occurs in best fit and first fit memory allocation method.

You might also like