Memory MGMT 1
Memory MGMT 1
BCA
Semester: V
Paper code:-BCA 301
• A pair of base and limit registers define the logical address space.
• CPU must check every memory access generated in user mode to be sure that it is
between base and limit for that user.
• The user programs deals with the logical address and never sees the
physical addresses.
• Logical address — generated by the CPU also referred as virtual address.
• Physical address- address seen by the memory unit
• Logical and physical addresses are same in compile-time and load-time
address-binding schemes.
• logical (virtual) and physical addresses differ in execution-time address-
binding scheme.
• Logical address space is the set of all logical addresses generated by a
program.
• Physical address space is the set of all physical addresses generated by a
program.
© Institute of Information Technology and Management, D-29,
Institutional Area, Janakpuri, New Delhi-110058
Memory-Management Unit (MMU)
• Static Linking:-
• When we click the .exe (executable) file of the program and it starts
running, all the necessary contents of the binary file have been loaded
into the process's virtual address space.
• However, most programs also need to run functions from the system
libraries, and these library functions also need to be loaded.
• Disadvantage:-
• Every program generated must contain copies of exactly the same
common system library functions
• Dynamic Linking:-
• Every dynamically linked program contains a small, statically linked
function that is called when the program starts.
• This static function only maps the link library into memory and runs
the code that the function contains.
• Advantage:-
• Memory requirements of the program are reduced.
• A DLL is loaded into memory only once, whereas more than one
application may use a single DLL at the moment, thus saving memory
space.
© Institute of Information Technology and Management, D-29,
Institutional Area, Janakpuri, New Delhi-110058
Shared Libraries
• A shared library is a file containing object code that several files may use
simultaneously while executing.
• When a program is link edited with a shared library, the library code that defines
the program's external references is not copied into the program's object file.
Instead, a special section called .1ib that identifies the library code is created in the
object file.
• A shared library offers several benefits:-
• Save disk storage space. Shared library code is not copied into all the files that use
that code. It makes files smaller and use less disk space.
• Save memory. By sharing library code at run time the dynamic memory needs of
the processes are reduced.
• It makes executable files using library code easier to maintain.
© Institute of Information Technology and Management, D-29,
Institutional Area, Janakpuri, New Delhi-110058
Swapping