0% found this document useful (0 votes)
67 views13 pages

OOP II (JVM Internal, JIT Compiler)

The JVM (Java Virtual Machine) is an abstract machine that provides a runtime environment for executing Java bytecode. It loads, verifies, and executes Java code, and provides memory areas, class formats, and error handling. The JVM's internal architecture includes components like the classloader, method area, heap, stack, and execution engine. The JIT (Just-In-Time) compiler improves performance by compiling bytecode parts with similar functionality together. Java follows naming conventions like using CamelCase and capitalizing the first letter of each internal word.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views13 pages

OOP II (JVM Internal, JIT Compiler)

The JVM (Java Virtual Machine) is an abstract machine that provides a runtime environment for executing Java bytecode. It loads, verifies, and executes Java code, and provides memory areas, class formats, and error handling. The JVM's internal architecture includes components like the classloader, method area, heap, stack, and execution engine. The JIT (Just-In-Time) compiler improves performance by compiling bytecode parts with similar functionality together. Java follows naming conventions like using CamelCase and capitalizing the first letter of each internal word.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

OOP II

Java
JVM in details
• JVM (Java Virtual Machine) is an abstract machine. It is a
specification that provides runtime environment in which
java bytecode can be executed.
• JVMs are available for many hardware and software
platforms (i.e. JVM is platform dependent).
JVM in details
What is JVM:
• A specification where working of Java Virtual Machine is
specified. Its implementation has been provided by Sun
and other companies.
• An implementation Its implementation is known as JRE
(Java Runtime Environment).
• Runtime Instance Whenever you write java command on
the command prompt to run the java class, an instance
of JVM is created.
JVM in details
What it does:
The JVM performs following operation:
• Loads code
• Verifies code
• Executes code
• Provides runtime environment

JVM provides definitions for the:


• Memory area
• Class file format
• Register set
• Garbage-collected heap
• Fatal error reporting etc.
Internal Architecture of JVM
Internal Architecture of JVM
1) Classloader
• Classloader is a subsystem of JVM that is used to load
class files.

2) Class(Method) Area
• Class(Method) Area stores per-class structures such as
field and method data, the code for methods.
Internal Architecture of JVM
3) Heap
• It is the runtime data area in which objects are allocated.
4) Stack
Java Stack stores frames. It holds local variables and partial
results, and plays a part in method invocation and return.
A new frame is created each time a method is invoked. A
frame is destroyed when its method invocation completes.
Internal Architecture of JVM
5) Program Counter Register
• PC (program counter) register contains the address of the
Java virtual machine instruction currently being
executed.
6) Native Method Stack
• It contains all the native methods used in the application.
Internal Architecture of JVM
7) Execution Engine
It contains:
1) A virtual processor
2) Interpreter: Read bytecode stream then execute the
instructions.
3) 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.
Just-In-Time(JIT) Compiler
• In the past, most programs written in any language have
had to be recompiled, and sometimes, rewritten for each
computer platform. One of the biggest advantages of
Java is that you only have to write and compile a program
once. The Java on any platform will interpret the
compiled bytecode into instructions understandable by
the particular processor. However, the virtual machine
handles one bytecode instruction at a time. Using the
Java just-in-time compiler (really a second compiler) at
the particular system platform compiles the bytecode
into the particular system code (as though the program
had been compiled initially on that platform). Once the
code has been (re-)compiled by the JIT compiler, it will
usually run more quickly in the computer.
Java Naming Conventions:
Java Naming conventions:
• Java naming convention is a rule to follow as you decide
what to name your identifiers such as class, package,
variable, constant, method etc.
• But, it is not forced to follow. So, it is known as
convention not rule.
• All the classes, interfaces, packages, methods and fields
of java programming language are given according to java
naming convention.
Java Naming Conventions:
Java Naming Conventions:
CamelCase in java naming conventions:
• Java follows camelcase syntax for naming the
class, interface, method and variable.
• If name is combined with two words, second
word will start with uppercase letter always
e.g. actionPerformed(), firstName etc.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy