jvm plays an important role in execution of java program

21
How JVM plays an important in the execution of Java program Presented By Infocampus

Upload: siyaram-ray

Post on 13-Apr-2017

9 views

Category:

Education


0 download

TRANSCRIPT

Page 1: JVM plays an important role in execution of java program

How JVM plays an important in the execution of

Java program

Presented ByInfocampus

Page 2: JVM plays an important role in execution of java program

To write a program we need-

1) Editor– To type a program into, for example notepad,notepad++ etc.

2) Compiler – To convert high level language program into machine code

3) Linker – To combine different program files reference in your main program together.

Infocampus software Training Institute

Page 3: JVM plays an important role in execution of java program

4) Loader – To load the files from the secondary storage device like Hard Disk, Flash Drive , CD into RAM for execution.The loading is automatically done when we execute our code.

5) Execution – Actual execution of the program which is handled by OS(Operating System) & processor.

Page 4: JVM plays an important role in execution of java program

Java CodeCompilation & execution

Best Core Java Training in Bangalore

Page 5: JVM plays an important role in execution of java program

[1] Once we write a program , we have to save with the class name.java.[2]Once we execute a program .java file converts into .class file[3]JVM convert the .class file into machine code.[4]JVM divide the memory into stack and memory memory.[5]Then JVM call the class loader , class loader go back to the main class and find the all stack members and load into heap memory.

Page 6: JVM plays an important role in execution of java program

[5]Again control go back to the JVM , it loads the all static members into stack.[6]Then it try to identifies the main method and start the execution.[7]If main method is not there , then it will through the error and execution will stop.[8]Once execution done JVM call garbage collector to clear the memory.

Java Course in Bangalore

Page 7: JVM plays an important role in execution of java program

What is JVM

JVM stands for Java Virtual Machine.It is the engine that executes the java code.

It converts byte code to machine code

Infocampus Software Training institute

Page 8: JVM plays an important role in execution of java program

1) Java compiler produces code for a Virtual Machine.2) JVM compiled java code into bytecode. This bytecode gets interpreted on machines3) Between host system and Java source, Bytecode is an intermediate language.4) JVM is responsible for allocating a memory space.

Page 9: JVM plays an important role in execution of java program

Working of JVM

The JVM performs following works :1)Loads the java code2)Verifies the code3)Executes the code4)Provides runtime environment

Java Training Center Bangalore

Page 10: JVM plays an important role in execution of java program

Java is both Compiled & Interpreted

Language

Page 11: JVM plays an important role in execution of java program

Compiler :

A compiler is a program which converts a program from one level of language to another. Example conversion of C++ program into machine code. The java compiler converts high level java code into bytecode .

Page 12: JVM plays an important role in execution of java program

Interpreter :A interpreter is a program which converts a program at one level to another programming language at the same level. In Java , the JVM converts the bytecode into the native machine code

Advance Java Training in Bangalore

Page 13: JVM plays an important role in execution of java program

ArchitectureOf

Java Virtual Machine

Page 14: JVM plays an important role in execution of java program

[1] Classloader:Classloader is a subsystem of JVM which is used to load the class files into the memory.

[2] Class Area(Method Area):Class Area stores per-class structures such as the runtime constant pool, fields and methods, code for methods.

Java/j2ee classes bangalore

Page 15: JVM plays an important role in execution of java program

[3] Stack:Java Stack stores frames.It holds local variables and partial results, and plays a part in method invocation and return.Each thread has a private JVM stack, created at the same time as thread.

[4] Native Method Stack:Native Method Stack contains all the native methods used in the application.

Page 16: JVM plays an important role in execution of java program

[5] Heap:Heap is the runtime data area in which objects are allocated and stored.

[6] Program Counter Register:PC (program counter) register contains the address of the Java virtual machine instruction currently being executed.

Infocampus software Training Institute

Page 17: JVM plays an important role in execution of java program

[7] Execution Engine :Execution Engine contains :i) A virtual processorii) Interpreter: Read bytecode stream then execute the instructions.iii) Just-In-Time(JIT) compiler: It is used to improve the performance.JIT compiles parts of the byte code that have similar functionality at the same time, and hence reduces the amount of time needed for compilation.

Page 18: JVM plays an important role in execution of java program

To get the free placement assistanceAttend classes in Infocampus Software Training Institute forCore & Advance Java Course

Page 19: JVM plays an important role in execution of java program

Visit at :

1st

& 4th

Floor,Above HDFC BankNear Kalamandir Marathahalli,Bangalore,

Page 20: JVM plays an important role in execution of java program

Call @9738001024

Enquire at :

http://www.infocampus.co.in/java-training-bangalore.html

Page 21: JVM plays an important role in execution of java program

THANKYOU