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

GP - OS - Storage Allocation

The document discusses two types of storage allocation methods: contiguous and non-contiguous. Contiguous allocation allocates memory in a single block while non-contiguous uses techniques like paging and segmentation to allocate memory wherever space is available to avoid fragmentation. Paging divides memory into fixed-size frames and logical memory into pages of the same size mapped using a page table. Segmentation divides logical memory into variable-sized segments for a more programmer-relevant view.

Uploaded by

RAHUL SAINI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views

GP - OS - Storage Allocation

The document discusses two types of storage allocation methods: contiguous and non-contiguous. Contiguous allocation allocates memory in a single block while non-contiguous uses techniques like paging and segmentation to allocate memory wherever space is available to avoid fragmentation. Paging divides memory into fixed-size frames and logical memory into pages of the same size mapped using a page table. Segmentation divides logical memory into variable-sized segments for a more programmer-relevant view.

Uploaded by

RAHUL SAINI
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Storage Allocation Methods in Memory

Management

Storage Allocation and Management TechniquesThe Storage allocation can be of two


types:
(i) Contiguous storage allocation.
(ii) Non-contiguous storage allocation.

Contiguous Storage Allocation


► Contiguous storage allocation implies that a program’s data and instructions are
assured to occupy a single contiguous memory area.
► It is further subdivided into Fixed-partition storage allocation strategy and variable-
partition storage allocation strategy.
Contiguous:Divide the memory into fixed-sized blocks
1. Fixed-partition contiguous storage allocation
The processes with small address space use small partitions and processes with large
address space use large partitions. This is known as fixed partition contiguous storage
allocation.

2. Variable - partition contiguous storage allocation


This notion is derived from parking of vehicles on the sides of streets where the one
who manages to enter will get the space. Two vehicles can leave a space between them
that cannot be used by any vehicle. This means that whenever a process needs
memory, a search for the space needed by it, is done. If contiguous space is available to
accommodate that process, then the process is loaded into memory.

External Fragmentation
This phenomenon of entering and leaving the memory can cause the formation of
unusable memory holes (like the unused space between two vehicles). This is known as
External Fragmentation.

Non-contiguous Storage Allocation


To resolve the problem of external fragmentation and to enhance the degree of
multiprogramming to a greater extent, it was decided to sacrifice the simplicity of
allocating contiguous memory to every process. It was decided to have a
non-contiguous physical address space of a process so that a process could be allocated
memory wherever it was available.
There are 2 techniques for non-contiguous allocation:
1. Paging
2. Segmentation
Paging
In paging, physical memory is divided into fixed-size blocks called frames and the logical
memory is divided into the fixed-sized blocks called pages.
The size of a page is the same as that of a frame. The key idea of this method is to place
the pages of a process into the available frames of memory, whenever, this process is to
be executed. The address mapping is done by Page table.
Physical memory is divided into fixed size- blocks called FRAMES. (size is power of 2, for
example 512 bytes)
Logical memory is divided into blocks of the same size called PAGES.
Example

Suppose, if the main memory size is 16 KB and Frame size is 1 KB. Here, the main
memory will be divided into the collection of 16 frames of 1 KB each.

Advantages and Disadvantages of paging


Advantages :
no external fragmentation.
Simply memory management algorithm.
Swapping is easy(equal sized pages and page frame).

Disadvantages:
Internal fragmentation.
Page tables may consume more memory.

Segmentation
segmentation is another technique for the noncontiguous storage allocation. It is
different from paging as it supports users’ view of his program.
For a programmer it might be more relevant to divide the logical address space of his
program into variable sized segments (with respect to his view of main program,
subroutines, data, etc.) than to divide it into fixed size pages. Such variable sized
segments, which are a collection of logically related information, are the basis of
segmentation technique.

segmentation

For each segment, the table stores the starting address of the segment and the length
of the segment. A reference to a memory location includes a value that identifies a
segment and an offset.

Advantages and disadvantages of segmentation


Advantages :
no internal fragmentation.
Segment tables consume less memory than pages.
Lends itself to sharing data among processes.
Lends itself to protection.

Disadvantages: Costly memory management algorithm.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy