Memory Management (week 8) Flashcards
what are the 2 types of memory in the computer system
primary memory and secondary memory
primary memory holds __________
information while the CPU is using it
secondary memory stores ___________
information in storage devices while CPU is NOT using it
who is responsible for allocating and deallocating primary memory
memory manager
memory manager ensures that the memory is _______________
not abused and is used efficiently.
system calls with respect to the use of memory is found in ________ os
windows and unix
what are the requirements of memory manager
–> Minimize executable memory access time
–> Maximize executable memory size
–> Executable memory must be cost effective
what does the memory manager do ?
–> Allocates primary memory to processes
–> Maps process address space to primary
memory
–> Minimizes access time using cost-effective memory configuration
–> May use static or dynamic techniques
how is it like at the top and bottom of the storage hierarchy
At the top of the hierarchy is faster, but more expensive memory, e.g., registers (more frequently used)
At the bottom is slower, but cheaper memory, e.g., hard disk, tape drives. (less frequently used)
why is there a need to attach addresses to every single instruction in the program When a program is converted (compiled)
into executable form
–> Program instructions need to be stored in a particular order in order for the CPU to execute in the correct way.
–> Programs involve many ‘jumps’ to different parts of the program. In order to do this, there has to be a concept of addresses for every part of the program.
what is address binding
the process of attaching addresses to every single instruction of the program when the program is being compiled into executable form is called address binding
how to create an executable program
–> compile time: source code is converted to object code
–> link time: after compilation, there is a need to link it with the libraries. This executable file is stored in secondary storage devices
–> load time: When the executable file is run it is loaded into the RAM, where primary memory is allocated then the addresses are adjusted in address space where finally the address space is copied from secondary memory to primary memory
what are 3 ways to ensure that when a
program is loaded up into memory, each
instruction has an address. (types of address bindings)
compile time binding
load time binding
run time binding
how does compile time binding work ?
–> Addresses are attached to each instruction when program is compiled.
–> Program is loaded into same location in
memory whenever it is executed.
–> Cannot be relocated into different locations in memory.
–> good for single memory systems like ms dos
what is load time binding
–> During compilation, the program is attached with relocatable addresses. E.g., start at 0x0000.
–> When program is loaded into memory, the location of the first instruction is loaded into a special register
–> To access the program, take re-locatable address of instruction + value of special register
–> Once loaded into memory, the program cannot be relocated into another portion of the memory.