0% found this document useful (0 votes)
244 views18 pages

SEMINAR ON JVM

The document discusses a seminar presentation on the Java Virtual Machine (JVM). It defines the JVM as a software environment that allows Java programs to execute. The JVM specification defines an abstract computer and set of instructions. It loads Java class files, verifies them, and runs the bytecode using a Java interpreter. The JVM handles memory allocation, garbage collection, and security. It has components like the class loader, method area, heap, and stack.

Uploaded by

ajay_behera_1
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
244 views18 pages

SEMINAR ON JVM

The document discusses a seminar presentation on the Java Virtual Machine (JVM). It defines the JVM as a software environment that allows Java programs to execute. The JVM specification defines an abstract computer and set of instructions. It loads Java class files, verifies them, and runs the bytecode using a Java interpreter. The JVM handles memory allocation, garbage collection, and security. It has components like the class loader, method area, heap, and stack.

Uploaded by

ajay_behera_1
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18

SEMINAR ON:

JAVA VIRTUAL
MACHINE
PRESENTED BY : JIGNESH KUMAR PATEL

ROLL NO : 37024
5TH SEMESTER, MCA
WHAT IS VIRTUAL MACHINE ?

In general terms, a virtual machine in Computer is


Software that creates an environment between the
Computer Platform and the end user in which the end user
can operate Software.

Virtual machine is the creation of a number of different


identical execution environments on a single computer,
each of which exactly emulates the host computer. This
provides each user with the illusion of having an entire
Computer but one that is their "private" machine,
isolated from other users, all on a single physical
machine.
JAVA VIRTUAL MACHINE
Java Virtual Machine is a environment where the java
programs execute. The Java Virtual Machine specification
defines an Abstract computer and specifies a set of instructions
that JVM can execute.
Java .Class File

Class loader

Verifier

Java Interpreter

Host System
Functions of JVM

Allocating memory for created objects.


Performing Garbage Collection.
Handling register and Stack Operations.
Calling on Host System for certain functions such
as Device Access.
Monitoring the Security of Java Applets.
JVM ARTCHITECTURE
• In the Java virtual machine specification, the
behaviour of a virtual machine instance is
described in terms of subsystems, memory
areas, data types, and instructions.

• The Java virtual machine organizes the


memory it needs to execute a program into
several runtime data areas.
Block Diagram of JVM
Runtime data areas exclusive to each thread
Class Loader Subsystem
It takes care of finding and loading classes.

Two types of Class Loaders


1.Boot Strap Class Loader.
2.User Defined Class Loader.
Loading, Linking and Initialization
• Loading: Finding and importing the binary data for a
type
• Linking: Performing verification, preparation, and
(optionally) resolution
– Verification: ensuring the correctness of the
imported type
– Preparation: allocating memory for class variables
and initializing the memory to default values
– Resolution: transforming symbolic references
from the type into direct references.
• Initialization: Invoking Java code that initializes
class variables to their proper starting values
METHOD AREA
• Inside a Java virtual machine instance,
information about loaded types is stored in a
logical area of memory called the method area.
• The virtual machine extracts information about
the type from the binary data and stores the
information in the method area. Memory for
class (static) variables declared in the class is
also taken from the method area.
Type Information

For each type it loads, a Java virtual machine must


store the following kinds of information in the method
area:
• The fully qualified name of the type .
• The fully qualified name of the type's direct super
class .
• Whether or not the type is a class or an interface
• An ordered list of the fully qualified names of any
direct super interfaces
The Constant Pool

A constant pool is an ordered set of constants


used by the type, including literals (string, integer,
and floating point constants) and symbolic
references to types, fields, and methods. It holds
symbolic references to all types, fields, and
methods used by a type, so it plays a central role
in the dynamic linking of Java programs.
HEAP
Whenever a class instance or array is created in
a running Java application, the memory for the
new object is allocated from a single heap.
There is only one heap inside the virtual
machine instance so all the thread share it.
One possible heap representation for arrays
GARBAGE COLLECTION
A garbage collector's primary function is to
automatically reclaim the memory used by
objects that are no longer referenced by the
running application. It may also move objects as
the application runs to reduce heap
fragmentation.
JAVA STACK
The Java stack is composed of stack frames (or
frames). A stack frame contains the state of one
Java method invocation. When a thread invokes a
method, the Java virtual machine pushes a new
frame onto that thread's Java stack. When the
method completes, the virtual machine pops and
discards the frame for that method.
EXECUTION ENGINE
At the core of any Java virtual machine
implementation is its execution engine. In the
Java virtual machine specification, the
behaviour of the execution engine is defined in
terms of an instruction set. For each instruction,
the specification describes in detail what an
implementation should do when it encounters
the instruction as it executes byte codes .

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