SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
RUN TIME ADMINISTRATION
• STORAGE ALLOCATION STRATEGIES.
• A BRIEF COMPARISON BETWEEN
STORAGE ALLOCATION STRATEGIES.
• ACCESS TO NON LOCAL NAMES.
• BLOCK STRUCTURE STORAGE
ALLOCATION.
• ACTIVATION RECORD.
Storage allocation strategies-
Static
Stack
Heap Stack-based Allocation.
Storage is organized as a stack.
Activation records are pushed and
popped.
Ex :- Pascal , C
Heap Allocation
The storage is allocated and deallocated
at runtime from a data area known as
heap
Ex :- Pascal
Static Allocation.
Storage is allocated for all data objects
at compile time
Ex :- Fortran
Static Allocation
In this allocation scheme, the
compilation data is bound to
a fixed location in the
memory and it does not
change when the program
executes.
As the memory requirement
and storage locations are
known in advance,
runtime support package for
memory allocation and de-
allocation is not
required.
Static Allocation
 Statically allocated names are bound to relocatable storage
at compile time.
 Storage bindings of statically allocated names never change.
 The compiler uses the type of a name (retrieved from the
symbol table) to determine storage size required.
 The required number of bytes (possibly aligned) is set aside
for the name.
 The relocatable address of the storage is fixed at compile
time.
Static Allocation
 In a static environment (Fortran 77) there are a number of
restrictions:
 Size of data objects are known at compile time
 No recursive procedures
 No dynamic memory allocation
 Only one copy of each procedure activation record exists at
time t
 We can allocate storage at compile time
• Bindings do not change at runtime
• Every time a procedure is called, the same bindings
occur
Static Allocation
 Limitations:
 The size required must be known at compile time.
 Recursive procedures cannot be implemented statically.
 No data structure can be created dynamically as all data is
static.
Stack Allocation
Procedure calls and their
activations are managed by
means of stack memory
allocation.
It works in last-in-first-out LIFO
method and this allocation
strategy is very useful for
recursive procedure
calls.
Stack Allocation
 In a stack-based allocation, the previous restrictions are lifted
(Pascal, C, etc)
 Procedures are allowed to be called recursively
• Need to hold multiple activation records for the same
procedure
• Created as required and placed on the stack
 Each record will maintain a pointer to the record that
activated it
 On completion, the current record will be deleted
from the stack and control is passed to the calling
record
 Dynamic memory allocation is allowed
 Pointers to data locations are allowed
Stack Allocation
 Storage is organized as a stack.
 Activation records are pushed and popped.
 Locals and parameters are contained in the activation records
for the call.
 This means locals are bound to fresh storage on every call.
 We just need a stack_top pointer.
 To allocate a new activation record, we just increase stack_top.
 To deallocate an existing activation record, we just decrease
stack_top
Stack Allocation
Advantages
 It supports recursion as memory is always allocated on
block entry.
 It allows to create data structures dynamically.
 It allows an array declaration like A(I, J), since actual
allocation is made only at execution time. The dimension
bounds need not be known at compile time.
Disadvantages:
 Memory addressing has to be effected through pointers and
index registers which may be store them, static allocation
especially in case of array reference.
Heap Allocation
Variables local to a procedure
are allocated and de-allocated
only at runtime. Heap allocation
is used to dynamically allocate
memory to the variables and
claim it back when the variables
are no more required.
Except statically allocated
memory area, both stack and
heap memory can grow and
shrink dynamically and
unexpectedly. Therefore, they
cannot be provided with a fixed
amount of
memory in the system.
Heap Allocation
Stack allocation cannot be used if:
 The values of the local variables must be retained when an
activation ends
 A called activation outlives the caller
 In such a case de-allocation of activation record cannot occur
in last-in first-out fashion
 Heap allocation gives out pieces of contiguous storage for
activation record
Heap Allocation
There are two aspects of dynamic allocation :
 Runtime allocation and de-allocation of data structures
 Languages like Algol have dynamic data structures and it
reserves some part of memory for it.
If a procedure wants to put a value that is to be used after its
activation is over then we cannot use stack for that purpose. That
is language like Pascal allows data to be allocated under program
control. Also in certain language a called activation may outlive the
caller procedure. In such a case last-in-first-out queue will not
work and we will require a data structure like heap to store the
activation. The last case is not true for those languages whose
activation trees correctly depict the flow of control between
procedures.
Heap Allocation
 Some languages do not have tree-structured allocations.
 In these cases, activations have to be allocated on the heap.
 This allows strange situations, like called activations that live
longer than their callers’ activations.
 This is not common.
 Pieces may be de-allocated in any order.
 Over time the heap will consist of alternate areas that are
free and in use.
Heap Allocation
 Heap manager is supposed to make use of the free space.
 For efficiency reasons it may be helpful to handle small
activations as a special case.
 For each size of interest keep a linked list of free blocks of
that size.
 Fill a request of size s with block of size s ' where s ' is the
smallest size greater than or equal to s
 For large blocks of storage use heap manager
Heap Allocation
 For large amount of storage computation may take some time
to use up memory so that time taken by the manager may be
negligible compared to the computation time
 For efficiency reasons we can handle small activations and
activations of predictable size as a special case as follows:
1. For each size of interest, keep a linked list if free blocks
of that size
2. If possible, fill a request for size s with a block of size s',
where s' is the smallest size greater than or equal to s.
When the block is eventually de-allocated, it is returned
to the linked list it came from.
Heap Allocation
3. For large blocks of storage use the heap manager.
 Heap manger will dynamically allocate memory. This will
come with a runtime overhead. As heap manager will
have to take care of defragmentation and garbage
collection. But since heap manger saves space otherwise
we will have to fix size of activation at compile time,
runtime overhead is the price worth it
Sr no. Static allocation Stack allocation Heap allocation
1.
Static Allocation is
done for all data
objects at compile
time
In stack allocation,
stack is used to
manage runtime
In heap allocation,
heap is used to
manage dynamic
memory allocation
2.
Data structures can
not be created
dynamically as the
amount of data
storage required by
each data object is
determined by
compiler
Data structures and
data objects can
be created
dynamically
Data structures and
data objects can be
created
dynamically
Sr no. Static allocation Stack allocation Heap allocation
3.
Memory allocation:
The names of data
objects are bound
to storage at
compile time.
Memory allocation:
Using ( LIFO )
activation records
and data objects
are pushed onto
the stack. Memory
addressing can be
done using index
and registers.
Memory allocation:
A contiguous block
of memory from
heap is allocated
for activation
record or data
object . A linked list
is maintained for
free blocks.
Access to non-local
names
Scope rules determine the
treatment of non-local names.
A common rule is lexical scoping
or static scoping (most
languages use lexical scoping).
The scope rules of a language
decide how to reference the
non-local variables.
.
Access to non-local names
 There are two methods that are commonly used :
1. Static or Lexical scoping : It determines the
declaration that applies to a name by examining the
program text alone.
Ex :- Pascal, C and ADA.
2. Dynamic Scoping : It determines the declaration
applicable to a name at run time by considering
the current activations.
Ex :- Lisp
Access to non-local names
Static or Lexical scoping
Access Links
 A direct implementation of lexical scope for nested procedures
is obtained be adding a pointer called an access link to each
activation record.
 If procedure p is nested immediately within q in the source text,
then the access link in an activation record for p points to the
access link in the record for the most recent activation of q.
Access to non-local names
Static or Lexical scoping
Displays
 Faster access to non-locals than with access links can be
obtained using an array d of pointers to activation records,
called a display.
 We maintain the display so that storage for a non-
local a at nesting depth i is in the activation record pointed to
by display element d [i].
Access to non-local names
Dynamic scoping
Deep Access
 Conceptually, dynamic scope results if access links point to the
same activation records that control links do.
 A simple implementation is to dispense with access links and
use the control link to search into the stack, looking for the first
activation record containing storage for the non-local name.
 The term deep access comes from the fact that the search may
go "deep" into the stack.
Access to non-local names
Dynamic scoping
Shallow Access
 Here the idea is to hold the current value of each name in
statically allocated storage.
 When a new activation of a procedure p occurs, a local name
n in p takes over the storage statically allocated for n.
 The previous value of n can be saved in the activation record
for p and must be restored when the activation of p ends.
Block
Blocks can be nested
The property is referred to as
block structured
Blocks are simpler to handle
than procedures
Block
 Blocks can be nested.
 The property is referred to as block structured.
 Blocks are simpler to handle than procedures
 Blocks can be treated as parameter less procedures
 Use stack for memory allocation
 Allocate space for complete procedure body at one time
Block
 Scope of the declaration is given by most closely nested rule
• The scope of a declaration in block B includes B
• If a name X is not declared in B then an occurrence of X is in
the scope of declarator X in B ' such that
o B ' has a declaration of X
o B ' is most closely nested around B
Block
 There are two methods of implementing block structure :
1. Stack Allocation : This is based on the observation that
scope of a declaration does not extend outside the block in
which it appears, the space for declared name can
be allocated when the block is entered and de-allocated
when controls leave the block. The view treat block as a
“parameter less procedure” called only from the point
just before the block and returning only to the point just
before the block.
Block
 There are two methods of implementing block structure :
2. Complete Allocation : Here you allocate the complete
memory at one time. If there are blocks within the
procedure, then allowance is made for the storage needed
for declarations within the books. If two variables are
never alive at the same time and are at same depth they
can be assigned same storage.
Activation
Record
The activation record is a
block of memory used for
managing information
needed by a single execution
of procedure
FORTRAN uses the static data
area to store the activation
record where as in PASCAL
and C the activation record is
situated in stack area
Activation record
 information needed by a single execution
of a procedure is managed using activation
record or frame:
• Not all compilers use all of the fields
• Pascal and C push activation record
on the run time stack when procedure
is called and pop the activation record
off the stack when control returns to
the caller
Activation record
1. Temporary values :-
Arising in the evaluation of expression
2. Local data :-
Data that is local to the execution of the
procedure
3. Saved machine status :-
State of the machine info before
procedure is called. Values of program
counter and machine registers that have to be restored when
control returns from the procedure .
Activation record
4. Access links :-
refers non local data held in other activation
records.
5. Control link :-
points to the activation record of the caller.
6. Actual parameters :-
used by the calling procedure to supply
parameters to the called procedure .
[ in practice these are passed in registers ]
7. Returned values :-
used by the called procedures to return a value to the calling
procedure.
[ in practice it is returned in a register ]
Activation record
The activation call for
factorial(3)
EXAMPLE
Activation record
REFERENCES
 www.slideshare.com
 Aho, Sethi & Ullman, “Compilers: Principles, Techniques and
Tools”, Pearson Education
 V Raghvan, “Principles of Compiler Design”, TMH
BY:
THANK
YOU
VIVEK BHUSHAN TIWARI
NILANSHI NIGAM
ARJUN SRIVASTAVA
ALANKAR MISHRA
RIYA AGARWAL

Contenu connexe

Tendances

Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed systemSunita Sahu
 
Principal source of optimization in compiler design
Principal source of optimization in compiler designPrincipal source of optimization in compiler design
Principal source of optimization in compiler designRajkumar R
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208Ameer Mehmood
 
Basic Processing Unit
Basic Processing UnitBasic Processing Unit
Basic Processing UnitSlideshare
 
Error Recovery strategies and yacc | Compiler Design
Error Recovery strategies and yacc | Compiler DesignError Recovery strategies and yacc | Compiler Design
Error Recovery strategies and yacc | Compiler DesignShamsul Huda
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)Computer_ at_home
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memoryAshish Kumar
 
The role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler designThe role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler designSadia Akter
 
Program security
Program securityProgram security
Program securityG Prachi
 
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptxParallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptxSumalatha A
 

Tendances (20)

Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Demand paging
Demand pagingDemand paging
Demand paging
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Principal source of optimization in compiler design
Principal source of optimization in compiler designPrincipal source of optimization in compiler design
Principal source of optimization in compiler design
 
Memory Organization
Memory OrganizationMemory Organization
Memory Organization
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Associative memory 14208
Associative memory 14208Associative memory 14208
Associative memory 14208
 
Basic Processing Unit
Basic Processing UnitBasic Processing Unit
Basic Processing Unit
 
Error Recovery strategies and yacc | Compiler Design
Error Recovery strategies and yacc | Compiler DesignError Recovery strategies and yacc | Compiler Design
Error Recovery strategies and yacc | Compiler Design
 
Message passing ( in computer science)
Message   passing  ( in   computer  science)Message   passing  ( in   computer  science)
Message passing ( in computer science)
 
Memory management
Memory managementMemory management
Memory management
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
The role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler designThe role of the parser and Error recovery strategies ppt in compiler design
The role of the parser and Error recovery strategies ppt in compiler design
 
Program security
Program securityProgram security
Program security
 
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptxParallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
 
Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 

En vedette

The dag representation of basic blocks
The dag representation of basic blocksThe dag representation of basic blocks
The dag representation of basic blocksShabeen Taj
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generationVipul Naik
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimizationWBUTTUTORIALS
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler designAnul Chaudhary
 
Compiler Optimization Presentation
Compiler Optimization PresentationCompiler Optimization Presentation
Compiler Optimization Presentation19magnet
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generationIffat Anjum
 
Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow GraphsJenny Galino
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)bolovv
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow AnalysisEdgar Barbosa
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMSkoolkampus
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generationrawan_z
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Tech_MX
 
CBSE XII Boolean Algebra
CBSE XII Boolean AlgebraCBSE XII Boolean Algebra
CBSE XII Boolean AlgebraGuru Ji
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Iffat Anjum
 

En vedette (20)

The dag representation of basic blocks
The dag representation of basic blocksThe dag representation of basic blocks
The dag representation of basic blocks
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 
Query processing-and-optimization
Query processing-and-optimizationQuery processing-and-optimization
Query processing-and-optimization
 
Peephole optimization techniques in compiler design
Peephole optimization techniques in compiler designPeephole optimization techniques in compiler design
Peephole optimization techniques in compiler design
 
Back patching
Back patchingBack patching
Back patching
 
Compiler Optimization Presentation
Compiler Optimization PresentationCompiler Optimization Presentation
Compiler Optimization Presentation
 
Lecture 16 17 code-generation
Lecture 16 17 code-generationLecture 16 17 code-generation
Lecture 16 17 code-generation
 
Basic Blocks and Flow Graphs
Basic Blocks and Flow GraphsBasic Blocks and Flow Graphs
Basic Blocks and Flow Graphs
 
Code generation
Code generationCode generation
Code generation
 
Chapter Seven(2)
Chapter Seven(2)Chapter Seven(2)
Chapter Seven(2)
 
Control Flow Analysis
Control Flow AnalysisControl Flow Analysis
Control Flow Analysis
 
Compiler Chapter 1
Compiler Chapter 1Compiler Chapter 1
Compiler Chapter 1
 
11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS11. Storage and File Structure in DBMS
11. Storage and File Structure in DBMS
 
Intermediate code- generation
Intermediate code- generationIntermediate code- generation
Intermediate code- generation
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)Symbol table design (Compiler Construction)
Symbol table design (Compiler Construction)
 
CBSE XII Boolean Algebra
CBSE XII Boolean AlgebraCBSE XII Boolean Algebra
CBSE XII Boolean Algebra
 
Compiler unit 4
Compiler unit 4Compiler unit 4
Compiler unit 4
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
 
Module 11
Module 11Module 11
Module 11
 

Similaire à Run time administration

Memory Allocation & Direct Memory Allocation in C & C++ Language PPT
Memory Allocation & Direct Memory Allocation in C & C++ Language PPTMemory Allocation & Direct Memory Allocation in C & C++ Language PPT
Memory Allocation & Direct Memory Allocation in C & C++ Language PPTAkhilMishra50
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory ManagementRahul Jamwal
 
Intermediate code optimization Unit-4.pdf
Intermediate code optimization Unit-4.pdfIntermediate code optimization Unit-4.pdf
Intermediate code optimization Unit-4.pdfHimanshu883663
 
Access to non local names
Access to non local namesAccess to non local names
Access to non local namesVarsha Kumar
 
SAP HANA Interview questions
SAP HANA Interview questionsSAP HANA Interview questions
SAP HANA Interview questionsIT LearnMore
 
10 Cache Implementation
10  Cache Implementation10  Cache Implementation
10 Cache ImplementationRanjan Kumar
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OSC.U
 
Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Iffat Anjum
 
Bab 4
Bab 4Bab 4
Bab 4n k
 
2015 01-17 Lambda Architecture with Apache Spark, NextML Conference
2015 01-17 Lambda Architecture with Apache Spark, NextML Conference2015 01-17 Lambda Architecture with Apache Spark, NextML Conference
2015 01-17 Lambda Architecture with Apache Spark, NextML ConferenceDB Tsai
 
Stacks
StacksStacks
StacksAcad
 
CPU Caching Concepts
CPU Caching ConceptsCPU Caching Concepts
CPU Caching ConceptsAbhijit K Rao
 
Policy Driven Dynamic LUN Space Optimization based on the Utilization
Policy Driven Dynamic LUN Space Optimization based on the UtilizationPolicy Driven Dynamic LUN Space Optimization based on the Utilization
Policy Driven Dynamic LUN Space Optimization based on the Utilizationidescitation
 

Similaire à Run time administration (20)

Memory Allocation & Direct Memory Allocation in C & C++ Language PPT
Memory Allocation & Direct Memory Allocation in C & C++ Language PPTMemory Allocation & Direct Memory Allocation in C & C++ Language PPT
Memory Allocation & Direct Memory Allocation in C & C++ Language PPT
 
C++ Memory Management
C++ Memory ManagementC++ Memory Management
C++ Memory Management
 
Intermediate code optimization Unit-4.pdf
Intermediate code optimization Unit-4.pdfIntermediate code optimization Unit-4.pdf
Intermediate code optimization Unit-4.pdf
 
Unit 5
Unit 5Unit 5
Unit 5
 
Compiler 2011-8-re1
Compiler 2011-8-re1Compiler 2011-8-re1
Compiler 2011-8-re1
 
Compiler 2011-8-re1
Compiler 2011-8-re1Compiler 2011-8-re1
Compiler 2011-8-re1
 
Access to non local names
Access to non local namesAccess to non local names
Access to non local names
 
SAP HANA Interview questions
SAP HANA Interview questionsSAP HANA Interview questions
SAP HANA Interview questions
 
10 Cache Implementation
10  Cache Implementation10  Cache Implementation
10 Cache Implementation
 
Chapter 9 OS
Chapter 9 OSChapter 9 OS
Chapter 9 OS
 
Opetating System Memory management
Opetating System Memory managementOpetating System Memory management
Opetating System Memory management
 
Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2Lecture 15 run timeenvironment_2
Lecture 15 run timeenvironment_2
 
Bab 4
Bab 4Bab 4
Bab 4
 
2015 01-17 Lambda Architecture with Apache Spark, NextML Conference
2015 01-17 Lambda Architecture with Apache Spark, NextML Conference2015 01-17 Lambda Architecture with Apache Spark, NextML Conference
2015 01-17 Lambda Architecture with Apache Spark, NextML Conference
 
Data structure
Data structureData structure
Data structure
 
Stacks
StacksStacks
Stacks
 
CPU Caching Concepts
CPU Caching ConceptsCPU Caching Concepts
CPU Caching Concepts
 
Megastore by Google
Megastore by GoogleMegastore by Google
Megastore by Google
 
Operating system
Operating systemOperating system
Operating system
 
Policy Driven Dynamic LUN Space Optimization based on the Utilization
Policy Driven Dynamic LUN Space Optimization based on the UtilizationPolicy Driven Dynamic LUN Space Optimization based on the Utilization
Policy Driven Dynamic LUN Space Optimization based on the Utilization
 

Dernier

March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...gerogepatton
 
input buffering in lexical analysis in CD
input buffering in lexical analysis in CDinput buffering in lexical analysis in CD
input buffering in lexical analysis in CDHeadOfDepartmentComp1
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptxAdityaGoogle
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
1- Practice occupational health and safety procedures.pptx
1- Practice occupational health and safety procedures.pptx1- Practice occupational health and safety procedures.pptx
1- Practice occupational health and safety procedures.pptxMel Paras
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Amil baba
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...IJAEMSJORNAL
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfalokitpathak01
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Amil baba
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfadeyimikaipaye
 

Dernier (20)

March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
March 2024 - Top 10 Read Articles in Artificial Intelligence and Applications...
 
input buffering in lexical analysis in CD
input buffering in lexical analysis in CDinput buffering in lexical analysis in CD
input buffering in lexical analysis in CD
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx10 AsymmetricKey Cryptography students.pptx
10 AsymmetricKey Cryptography students.pptx
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
1- Practice occupational health and safety procedures.pptx
1- Practice occupational health and safety procedures.pptx1- Practice occupational health and safety procedures.pptx
1- Practice occupational health and safety procedures.pptx
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
Uk-NO1 Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Exp...
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
 
Indian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdfIndian Tradition, Culture & Societies.pdf
Indian Tradition, Culture & Societies.pdf
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
 
Machine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdfMachine Learning 5G Federated Learning.pdf
Machine Learning 5G Federated Learning.pdf
 

Run time administration

  • 1. RUN TIME ADMINISTRATION • STORAGE ALLOCATION STRATEGIES. • A BRIEF COMPARISON BETWEEN STORAGE ALLOCATION STRATEGIES. • ACCESS TO NON LOCAL NAMES. • BLOCK STRUCTURE STORAGE ALLOCATION. • ACTIVATION RECORD.
  • 2. Storage allocation strategies- Static Stack Heap Stack-based Allocation. Storage is organized as a stack. Activation records are pushed and popped. Ex :- Pascal , C Heap Allocation The storage is allocated and deallocated at runtime from a data area known as heap Ex :- Pascal Static Allocation. Storage is allocated for all data objects at compile time Ex :- Fortran
  • 3. Static Allocation In this allocation scheme, the compilation data is bound to a fixed location in the memory and it does not change when the program executes. As the memory requirement and storage locations are known in advance, runtime support package for memory allocation and de- allocation is not required.
  • 4. Static Allocation  Statically allocated names are bound to relocatable storage at compile time.  Storage bindings of statically allocated names never change.  The compiler uses the type of a name (retrieved from the symbol table) to determine storage size required.  The required number of bytes (possibly aligned) is set aside for the name.  The relocatable address of the storage is fixed at compile time.
  • 5. Static Allocation  In a static environment (Fortran 77) there are a number of restrictions:  Size of data objects are known at compile time  No recursive procedures  No dynamic memory allocation  Only one copy of each procedure activation record exists at time t  We can allocate storage at compile time • Bindings do not change at runtime • Every time a procedure is called, the same bindings occur
  • 6. Static Allocation  Limitations:  The size required must be known at compile time.  Recursive procedures cannot be implemented statically.  No data structure can be created dynamically as all data is static.
  • 7. Stack Allocation Procedure calls and their activations are managed by means of stack memory allocation. It works in last-in-first-out LIFO method and this allocation strategy is very useful for recursive procedure calls.
  • 8. Stack Allocation  In a stack-based allocation, the previous restrictions are lifted (Pascal, C, etc)  Procedures are allowed to be called recursively • Need to hold multiple activation records for the same procedure • Created as required and placed on the stack  Each record will maintain a pointer to the record that activated it  On completion, the current record will be deleted from the stack and control is passed to the calling record  Dynamic memory allocation is allowed  Pointers to data locations are allowed
  • 9. Stack Allocation  Storage is organized as a stack.  Activation records are pushed and popped.  Locals and parameters are contained in the activation records for the call.  This means locals are bound to fresh storage on every call.  We just need a stack_top pointer.  To allocate a new activation record, we just increase stack_top.  To deallocate an existing activation record, we just decrease stack_top
  • 10. Stack Allocation Advantages  It supports recursion as memory is always allocated on block entry.  It allows to create data structures dynamically.  It allows an array declaration like A(I, J), since actual allocation is made only at execution time. The dimension bounds need not be known at compile time. Disadvantages:  Memory addressing has to be effected through pointers and index registers which may be store them, static allocation especially in case of array reference.
  • 11. Heap Allocation Variables local to a procedure are allocated and de-allocated only at runtime. Heap allocation is used to dynamically allocate memory to the variables and claim it back when the variables are no more required. Except statically allocated memory area, both stack and heap memory can grow and shrink dynamically and unexpectedly. Therefore, they cannot be provided with a fixed amount of memory in the system.
  • 12. Heap Allocation Stack allocation cannot be used if:  The values of the local variables must be retained when an activation ends  A called activation outlives the caller  In such a case de-allocation of activation record cannot occur in last-in first-out fashion  Heap allocation gives out pieces of contiguous storage for activation record
  • 13. Heap Allocation There are two aspects of dynamic allocation :  Runtime allocation and de-allocation of data structures  Languages like Algol have dynamic data structures and it reserves some part of memory for it. If a procedure wants to put a value that is to be used after its activation is over then we cannot use stack for that purpose. That is language like Pascal allows data to be allocated under program control. Also in certain language a called activation may outlive the caller procedure. In such a case last-in-first-out queue will not work and we will require a data structure like heap to store the activation. The last case is not true for those languages whose activation trees correctly depict the flow of control between procedures.
  • 14. Heap Allocation  Some languages do not have tree-structured allocations.  In these cases, activations have to be allocated on the heap.  This allows strange situations, like called activations that live longer than their callers’ activations.  This is not common.  Pieces may be de-allocated in any order.  Over time the heap will consist of alternate areas that are free and in use.
  • 15. Heap Allocation  Heap manager is supposed to make use of the free space.  For efficiency reasons it may be helpful to handle small activations as a special case.  For each size of interest keep a linked list of free blocks of that size.  Fill a request of size s with block of size s ' where s ' is the smallest size greater than or equal to s  For large blocks of storage use heap manager
  • 16. Heap Allocation  For large amount of storage computation may take some time to use up memory so that time taken by the manager may be negligible compared to the computation time  For efficiency reasons we can handle small activations and activations of predictable size as a special case as follows: 1. For each size of interest, keep a linked list if free blocks of that size 2. If possible, fill a request for size s with a block of size s', where s' is the smallest size greater than or equal to s. When the block is eventually de-allocated, it is returned to the linked list it came from.
  • 17. Heap Allocation 3. For large blocks of storage use the heap manager.  Heap manger will dynamically allocate memory. This will come with a runtime overhead. As heap manager will have to take care of defragmentation and garbage collection. But since heap manger saves space otherwise we will have to fix size of activation at compile time, runtime overhead is the price worth it
  • 18. Sr no. Static allocation Stack allocation Heap allocation 1. Static Allocation is done for all data objects at compile time In stack allocation, stack is used to manage runtime In heap allocation, heap is used to manage dynamic memory allocation 2. Data structures can not be created dynamically as the amount of data storage required by each data object is determined by compiler Data structures and data objects can be created dynamically Data structures and data objects can be created dynamically
  • 19. Sr no. Static allocation Stack allocation Heap allocation 3. Memory allocation: The names of data objects are bound to storage at compile time. Memory allocation: Using ( LIFO ) activation records and data objects are pushed onto the stack. Memory addressing can be done using index and registers. Memory allocation: A contiguous block of memory from heap is allocated for activation record or data object . A linked list is maintained for free blocks.
  • 20. Access to non-local names Scope rules determine the treatment of non-local names. A common rule is lexical scoping or static scoping (most languages use lexical scoping). The scope rules of a language decide how to reference the non-local variables. .
  • 21. Access to non-local names  There are two methods that are commonly used : 1. Static or Lexical scoping : It determines the declaration that applies to a name by examining the program text alone. Ex :- Pascal, C and ADA. 2. Dynamic Scoping : It determines the declaration applicable to a name at run time by considering the current activations. Ex :- Lisp
  • 22. Access to non-local names Static or Lexical scoping Access Links  A direct implementation of lexical scope for nested procedures is obtained be adding a pointer called an access link to each activation record.  If procedure p is nested immediately within q in the source text, then the access link in an activation record for p points to the access link in the record for the most recent activation of q.
  • 23. Access to non-local names Static or Lexical scoping Displays  Faster access to non-locals than with access links can be obtained using an array d of pointers to activation records, called a display.  We maintain the display so that storage for a non- local a at nesting depth i is in the activation record pointed to by display element d [i].
  • 24. Access to non-local names Dynamic scoping Deep Access  Conceptually, dynamic scope results if access links point to the same activation records that control links do.  A simple implementation is to dispense with access links and use the control link to search into the stack, looking for the first activation record containing storage for the non-local name.  The term deep access comes from the fact that the search may go "deep" into the stack.
  • 25. Access to non-local names Dynamic scoping Shallow Access  Here the idea is to hold the current value of each name in statically allocated storage.  When a new activation of a procedure p occurs, a local name n in p takes over the storage statically allocated for n.  The previous value of n can be saved in the activation record for p and must be restored when the activation of p ends.
  • 26. Block Blocks can be nested The property is referred to as block structured Blocks are simpler to handle than procedures
  • 27. Block  Blocks can be nested.  The property is referred to as block structured.  Blocks are simpler to handle than procedures  Blocks can be treated as parameter less procedures  Use stack for memory allocation  Allocate space for complete procedure body at one time
  • 28. Block  Scope of the declaration is given by most closely nested rule • The scope of a declaration in block B includes B • If a name X is not declared in B then an occurrence of X is in the scope of declarator X in B ' such that o B ' has a declaration of X o B ' is most closely nested around B
  • 29. Block  There are two methods of implementing block structure : 1. Stack Allocation : This is based on the observation that scope of a declaration does not extend outside the block in which it appears, the space for declared name can be allocated when the block is entered and de-allocated when controls leave the block. The view treat block as a “parameter less procedure” called only from the point just before the block and returning only to the point just before the block.
  • 30. Block  There are two methods of implementing block structure : 2. Complete Allocation : Here you allocate the complete memory at one time. If there are blocks within the procedure, then allowance is made for the storage needed for declarations within the books. If two variables are never alive at the same time and are at same depth they can be assigned same storage.
  • 31. Activation Record The activation record is a block of memory used for managing information needed by a single execution of procedure FORTRAN uses the static data area to store the activation record where as in PASCAL and C the activation record is situated in stack area
  • 32. Activation record  information needed by a single execution of a procedure is managed using activation record or frame: • Not all compilers use all of the fields • Pascal and C push activation record on the run time stack when procedure is called and pop the activation record off the stack when control returns to the caller
  • 33. Activation record 1. Temporary values :- Arising in the evaluation of expression 2. Local data :- Data that is local to the execution of the procedure 3. Saved machine status :- State of the machine info before procedure is called. Values of program counter and machine registers that have to be restored when control returns from the procedure .
  • 34. Activation record 4. Access links :- refers non local data held in other activation records. 5. Control link :- points to the activation record of the caller. 6. Actual parameters :- used by the calling procedure to supply parameters to the called procedure . [ in practice these are passed in registers ] 7. Returned values :- used by the called procedures to return a value to the calling procedure. [ in practice it is returned in a register ]
  • 35. Activation record The activation call for factorial(3) EXAMPLE
  • 37. REFERENCES  www.slideshare.com  Aho, Sethi & Ullman, “Compilers: Principles, Techniques and Tools”, Pearson Education  V Raghvan, “Principles of Compiler Design”, TMH
  • 38. BY: THANK YOU VIVEK BHUSHAN TIWARI NILANSHI NIGAM ARJUN SRIVASTAVA ALANKAR MISHRA RIYA AGARWAL

Notes de l'éditeur

  1. You can safely remove this slide. This slide design was provided by SlideModel.com – You can download more templates, shapes and elements for PowerPoint from http://slidemodel.com/