Run time storage management
Run time storage management
management
Run time storage management
We need to use memory to store
Code
Static data( local & global variables)
Dynamic data objects
Data that are used when executing a certain
procedure.
Dynamically allocated objects
free
malloc
Run time memory
Activation record
Memory can be managed by activation
records
Also called as frames
Information needed by a single execution of a
procedure
A general activation record has a seven fields
Activation record fields
Storage -memory
Static allocation
Stack allocation
Heap allocation
Static allocation
Lays out storage for all data objects at
compile time
Constraints
Size of the object must be known and alignment
requirements must be known at compile time
No recursion
No dynamic data structure
Stack allocation
Stack allocation manages the runtime
storage as a stack
The activation record is pushed on as a
function entered
The activation record is popped off as a
function exits.
Local variables bound to fresh storage.
Constraints:
Values of locals cannot be retained when an
activation ends.
Heap allocation
Allocates and deallocates storage as needed
at runtime from a data area called as heap
Does not require the activation of procedures
to be LIFO
Requires true dynamic memory management.