0% found this document useful (0 votes)
2 views5 pages

Memory Management

Memory management is crucial for efficient data storage in computers, as it tracks memory allocation and protects processes from corruption. It includes techniques like contiguous and non-contiguous memory management, as well as address binding, which maps logical addresses to physical memory locations. Additionally, linking and loading are essential processes for preparing executable programs, with static and dynamic methods for both linking and loading to optimize memory usage.

Uploaded by

manveetsidhu2025
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)
2 views5 pages

Memory Management

Memory management is crucial for efficient data storage in computers, as it tracks memory allocation and protects processes from corruption. It includes techniques like contiguous and non-contiguous memory management, as well as address binding, which maps logical addresses to physical memory locations. Additionally, linking and loading are essential processes for preparing executable programs, with static and dynamic methods for both linking and loading to optimize memory usage.

Uploaded by

manveetsidhu2025
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/ 5

Memory Management:

➢ What do you mean by memory management?

ANS: Memory is the important part of the computer that is used to store the data. Its
management is critical to the computer system because the amount of main memory
available in a computer system is very limited. At any time, many processes are competing
for it. Moreover, to increase performance, several processes are executed simultaneously.
For this, we must keep several processes in the main memory, so it is even more important
to manage them effectively.

Role of Memory management


Following are the important roles of memory management in a computer system:

o Memory manager is used to keep track of the status of memory locations, whether it is
free or allocated. It addresses primary memory by providing abstractions so that software
perceives a large memory is allocated to it.
o Memory manager permits computers with a small amount of main memory to execute
programs larger than the size or amount of available memory. It does this by moving
information back and forth between primary memory and secondary memory by using the
concept of swapping.
o The memory manager is responsible for protecting the memory allocated to each process
from being corrupted by another process. If this is not ensured, then the system may
exhibit unpredictable behavior.
o Memory managers should enable sharing of memory space between processes. Thus, two
programs can reside at the same memory location although at different times.

Memory Management Techniques:


The memory management techniques can be classified into following main
categories:

o Contiguous memory management schemes


o Non-Contiguous memory management schemes
1. Contiguous memory management schemes:
In a Contiguous memory management scheme, each program occupies a single
contiguous block of storage locations, i.e., a set of memory locations with consecutive
addresses.

2. Non-Contiguous memory management schemes:


In a Non-Contiguous memory management scheme, the program is divided into different
blocks and loaded at different portions of the memory that need not necessarily be
adjacent to one another. This scheme can be classified depending upon the size of blocks
and whether the blocks reside in the main memory or not.

Address binding in Operating System:


➢ .What is address binding in the operating
system?
ANS: The Address Binding refers to the mapping of computer instructions and data
to physical memory locations. Both logical and physical addresses are used in
computer memory. It assigns a physical memory region to a logical pointer by
mapping a physical address to a logical address known as a virtual address. It is
also a component of computer memory management that the OS performs on
behalf of applications that require memory access.

Types of Address Binding in Operating System


There are mainly three types of an address binding in the OS. These are as follows:

1. Compile Time Address Binding


2. Load Time Address Binding
3. Execution Time or Dynamic Address Binding
1.Compile Time Address Binding
It is the first type of address binding. It occurs when the compiler is responsible for
performing address binding, and the compiler interacts with the operating system to
perform the address binding. In other words, when a program is executed, it allocates
memory to the system code of the computer. The address binding assigns a logical
address to the beginning of the memory segment to store the object code. Memory
allocation is a long-term process and may only be modified by recompiling the program.

2.Load Time Address Binding


It is another type of address binding. It is done after loading the program in the memory,
and it would be done by the operating system memory manager, i.e., loader. If memory
allocation is specified when the program is assigned, no program in its compiled state
may ever be transferred from one computer to another. Memory allocations in the
executable code may already be in use by another program on the new system. In this
case, the logical addresses of the program are not connected to physical addresses until
it is applied and loaded into memory.

3.Execution Time or Dynamic Address Binding


Execution time address binding is the most popular type of binding for scripts that aren't
compiled because it only applies to variables in the program. When a variable in a
program is encountered during the processing of instructions in a script, the program
seeks memory space for that variable. The memory would assign the space to that variable
until the program sequence finished or unless a specific instruction within the script
released the memory address connected to a variable.

Linking and Loading are utility programs that play an important role in the
execution of a program. Linking intakes the object codes generated by the
assembler and combines them to generate the executable module. On the other
hand, the loading loads this executable module to the main memory for
execution.

QUS : What is Loading?

ANS: To bring the program from secondary memory to main memory is called
Loading. It is performed by a loader. It is a special program that takes the input
of executable files from the linker, loads it to the main memory, and prepares this
code for execution by a computer.
There are two types of loading in the operating system:
• Static Loading:
• Loading the entire program into the main memory before the start of
the program execution is called static loading.
• If static loading is used then accordingly static linking is applied.
• Dynamic Loading:
• Loading the program into the main memory on demand is called
dynamic loading.
• If dynamic loading is used then accordingly dynamic linking is
applied.

QUS:What is Linking?

ANS: Establishing the linking between all the modules or all the functions of the
program in order to continue the program execution is called linking. Linking is a
process of collecting and maintaining pieces of code and data into a single file.
Linker also links a particular module into the system library. It takes object
modules from the assembler as input and forms an executable file as output for
the loader. Linking is performed at both compile time when the source code is
translated into machine code, and load time, when the program is loaded into
memory by the loader. Linking is performed at the last step in compiling a
program.
• Static Linking:
• A statically linked program takes constant load time every time it is
loaded into the memory for execution.
• Static linking is performed by programs called linkers as the last step
in compiling a program. Linkers are also called link editors.
• In static linking, if any of the external programs has changed then
they have to be recompiled and re-linked again else the changes
won’t reflect in the existing executable file.
• Dynamic Linking:
• Dynamic linking is performed at run time by the operating system.
• In dynamic linking, this is not the case and individual shared modules
can be updated and recompiled. This is one of the greatest
advantages dynamic linking offers.
• In dynamic linking load time might be reduced if the shared library
code is already present in memory.

Differences between Linking and Loading


Linking Loading

Loading is the process of loading


The process of collecting and maintaining pieces of
the program from secondary
code and data into a single file is known as Linking
memory to the main memory for
in the operating system.
execution.

Loading is used to allocate the


Linking is used to join all the modules. address to all executable files
and this task is done by the
loader.

Linking is performed with the help of Linker. In


A loader is a program that places
an operating system, Linker is a program that helps
programs into memory and
to link object modules of a program into a single
prepares them for execution.
object file. It is also called a link editor.

Linkers are an important part of the software


development process because they enable separate
The loader is responsible for the
compilation. Apart from that organizing a large
allocation, linking, relocation,
application as one monolithic source file, we can
and loading of the operating
decompose it into smaller, more
system
manageable modules that can be modified and
compiled separately.

You might also like