0% found this document useful (0 votes)
7 views8 pages

What Is Memory

Computer memory is a collection of data in binary format, which can be classified into various categories based on its functions. Data is stored in memory after being converted into binary language, and the size of the main memory affects the degree of multiprogramming and CPU utilization. Fixed and dynamic partitioning are techniques for memory allocation, with dynamic partitioning addressing some limitations of fixed partitioning, such as internal fragmentation and process size restrictions.

Uploaded by

rajalakshmicom85
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)
7 views8 pages

What Is Memory

Computer memory is a collection of data in binary format, which can be classified into various categories based on its functions. Data is stored in memory after being converted into binary language, and the size of the main memory affects the degree of multiprogramming and CPU utilization. Fixed and dynamic partitioning are techniques for memory allocation, with dynamic partitioning addressing some limitations of fixed partitioning, such as internal fragmentation and process size restrictions.

Uploaded by

rajalakshmicom85
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/ 8

What is Memory?

Computer memory can be defined as a collection of some data


represented in the binary format. On the basis of various functions,
memory can be classified into various categories. We will discuss each
one of them later in detail.

A computer device that is capable to store any information or data


temporally or permanently, is called storage device.

How Data is being stored in a computer system?


In order to understand memory management, we have to make
everything clear about how data is being stored in a computer system.

Machine understands only binary language that is 0 or 1. Computer


converts every data into binary language first and then stores it into the
memory.

That means if we have a program line written as int α = 10 then the


computer converts it into the binary language and then store it into the
memory blocks.

The representation of inti = 10 is shown below.

The binary representation of 10 is 1010. Here, we are considering 32 bit


system therefore, the size of int is 2 bytes i.e. 16 bit. 1 memory block
stores 1 bit. If we are using signed integer then the most significant bit in
the memory array is always a signed bit.
Signed bit value 0 represents positive integer while 1 represents negative
integer. Here, the range of values that can be stored using the memory
array is -32768 to +32767.

well, we can enlarge this range by using unsigned int. in that case, the bit
which is now storing the sign will also store the bit value and therefore the
range will be 0 to 65,535.

Need for Multi programming


However, The CPU can directly access the main memory, Registers and
cache of the system. The program always executes in main memory. The
size of main memory affects degree of Multi programming to most of the
extant. If the size of the main memory is larger than CPU can load more
processes in the main memory at the same time and therefore will
increase degree of Multi programming as well as CPU utilization.

ADVERTISEMENT

1. Let's consider,
2. Process Size = 4 MB
3. Main memory size = 4 MB
4. The process can only reside in the main memory at any time.
5. If the time for which the process does IO is P,
6.
7. Then,
8.
9. CPU utilization = (1-P)
10. let's say,
11. P = 70%
12. CPU utilization = 30 %
13. Now, increase the memory size, Let's say it is 8 MB.
14. Process Size = 4 MB
15. Two processes can reside in the main memory at the same time.
16. Let's say the time for which, one process does its IO is P,
17.
18. Then
19.
20. CPU utilization = (1-P^2)
21. let's say P = 70 %
22. CPU utilization = (1-0.49) =0.51 = 51 %
Therefore, we can state that the CPU utilization will be increased if the
memory size gets increased.

Fixed Partitioning
The earliest and one of the simplest technique which can be used to load
more than one processes into the main memory is Fixed partitioning or
Contiguous memory allocation.

In this technique, the main memory is divided into partitions of equal or


different sizes. The operating system always resides in the first partition
while the other partitions can be used to store user processes. The
memory is assigned to the processes in contiguous way.

In fixed partitioning,

1. The partitions cannot overlap.


2. A process must be contiguously present in a partition for the
execution.

There are various cons of using this technique.

PlayNext
Mute

Current Time 0:07

Duration 18:10
Loaded: 4.40%
Â
Fullscreen

1. Internal Fragmentation

If the size of the process is lesser then the total size of the partition then
some size of the partition get wasted and remain unused. This is wastage
of the memory and called internal fragmentation.

As shown in the image below, the 4 MB partition is used to load only 3 MB


process and the remaining 1 MB got wasted.

2. External Fragmentation
The total unused space of various partitions cannot be used to load the
processes even though there is space available but not in the contiguous
form.

As shown in the image below, the remaining 1 MB space of each partition


cannot be used as a unit to store a 4 MB process. Despite of the fact that
the sufficient space is available to load the process, process will not be
loaded.

ADVERTISEMENT

3. Limitation on the size of the process

If the process size is larger than the size of maximum sized partition then
that process cannot be loaded into the memory. Therefore, a limitation
can be imposed on the process size that is it cannot be larger than the
size of the largest partition.

4. Degree of multiprogramming is less

By Degree of multi programming, we simply mean the maximum number


of processes that can be loaded into the memory at the same time. In
fixed partitioning, the degree of multiprogramming is fixed and very less
due to the fact that the size of the partition cannot be varied according to
the size of processes.
Dynamic Partitioning
Dynamic partitioning tries to overcome the problems caused by fixed
partitioning. In this technique, the partition size is not declared initially. It
is declared at the time of process loading.

The first partition is reserved for the operating system. The remaining
space is divided into parts. The size of each partition will be equal to the
size of the process. The partition size varies according to the need of the
process so that the internal fragmentation can be avoided.
Advantages of Dynamic Partitioning over fixed
partitioning

1. No Internal Fragmentation
Given the fact that the partitions in dynamic partitioning are created
according to the need of the process, It is clear that there will not be any
internal fragmentation because there will not be any unused remaining
space in the partition.

2. No Limitation on the size of the process


In Fixed partitioning, the process with the size greater than the size of the
largest partition could not be executed due to the lack of sufficient
contiguous memory. Here, In Dynamic partitioning, the process size can't
be restricted since the partition size is decided according to the process
size.

PauseNext
Mute

Current Time 0:01


/

Duration 18:10
Loaded: 3.30%
Â
Fullscreen

3. Degree of multiprogramming is dynamic


Due to the absence of internal fragmentation, there will not be any
unused space in the partition hence more processes can be loaded in the
memory at the same time.

Disadvantages of dynamic partitioning

External Fragmentation
Absence of internal fragmentation doesn't mean that there will not be
external fragmentation.

Let's consider three processes P1 (1 MB) and P2 (3 MB) and P3 (1 MB) are
being loaded in the respective partitions of the main memory.

After some time P1 and P3 got completed and their assigned space is
freed. Now there are two unused partitions (1 MB and 1 MB) available in
the main memory but they cannot be used to load a 2 MB process in the
memory since they are not contiguously located.

The rule says that the process must be contiguously present in the main
memory to get executed. We need to change this rule to avoid external
fragmentation.
Complex Memory Allocation
In Fixed partitioning, the list of partitions is made once and will never
change but in dynamic partitioning, the allocation and deallocation is very
complex since the partition size will be varied every time when it is
assigned to a new process. OS has to keep track of all the partitions.

ADVERTISEMENT

Due to the fact that the allocation and deallocation are done very
frequently in dynamic memory allocation and the partition size will be
changed at each time, it is going to be very difficult for OS to manage
everything.

You might also like