[TOC]OverviewThe virtual machine loads the data of the description class from the class file into the memory, verifies the data, parses and initializes it, and finally forms the Java type that can be used directly by the virtual machine, which is the class loading mechanism
Schematic diagram of Java Virtual Machine 1.4 field table set in the class file -- how the field is organized in the class file, graphic tutorial on Virtual Machine networking0. Preface
Understanding the principles of JVM virtual
Get a glimpse of the location of the Dalvik virtual machine in the Android system frame chart:Article directory: First, virtual machine briefIi. A brief description of the Java Virtual machineThree, Dalvik
1. Creation of Objects
1.1 class Load Check
When a virtual opportunity comes to a new command, it first checks whether the parameter of the instruction can navigate to a class's symbolic reference in a constant pool, and checks whether the class represented by the symbolic reference has been loaded, parsed, and initialized. If not, the corresponding class loading process is performed first. 1.2 Allocating memory
Divides a certain size of memory from
(Resource R1, Resource r2) {this.r1 = r1; THIS.R2 = R2; } @Override public void Run () {int j = 0; while (true) {synchronized (R2) {System.out.println ("the second thread got R2 ' s lock "+ j); Synchronized (R1) {System.out.println ("the second thread got R1 ' s lock" + j); }} j + +; } } }Open VISUALVM detected JVM process, we can see this tab is flashing, VISUALVM has detected my package under the deadlock class
The class file binary character stream is loaded into memory (method area) through the ClassLoader and virtual machines. After the layout and initialization of the memory, the virtual machine bytecode execution engine can execute the functions defined by the relevant code implementation program. The object that the virtual
Structure of class fileThere are two structures in Java's class file: unsigned numbers and tables. The smallest storage unit is 8 bytes.Unsigned numbers are the basic data types used to describe numbers, UTF-8 encoded strings, and index references.Represents a complex data structure that consists of multiple unsigned numbers.which
Magic is the magic number, and the magic number takes up 4 bytes, what is the magic number to do? It actually means that the type of the file is a class file, no
C + + and other pure compilation language from the source to the final implementation of the general experience: compile, connect and run three stages, the connection is completed during the compilation, and Java during the compilation is only the Java Virtual machine can recognize the source code class file,
void Sspin () { short i; for (i = 0; i ) { // }}Method void Sspin ()0 Iconst_0 int constant value 0 in-stack1 Istore_1 The value of the stack-top int into the specified local variable2 Goto 105 iload_1 the specified int type local variable into the stack6 Iconst_1 int constant value 1 in-stack7 Iadd stack top two int values are added, and the result is in the stack8 I2S Stack Top int value strong to short value, and result in stack9 Istore_1 The value of the stack-top int into the spe
Deep understanding of Java Virtual Machine _ Chapter 2 _ Reading Notes and deep understanding of virtual machines
1. Contents of this chapter:
Overview
Data Area During Running
Program counters
Java Virtual
0. Preface Java virtual machines, like real computers, perform binary machine codes, and we compile. Java source code into a. class file, and the class file is the binary machine code that the Java
Deep understanding of Java Virtual Machine notes-class loading process, deep understanding of virtual machinesI. LoadingThe Loading stage is a stage of the Class Loading process. In the loading phase, the virtual machine must comp
1 Overview
The Virtual Machine loads the description class data from the class file to the virtual machine, verifies, converts, parses, and initializes the data, and finally forms the Java type that can be directly used by the virtual
Java Virtual machine Model
Because of its high portability, Java has become the primary programming language on the Internet.
The concept of "simulator" is one of the most commonly used explanations of virtual machines in computer industry. This
in memory management, Java differs from C and C + + in that Java has dynamic memory allocation and garbage collection technology, but usually we seldom pay attention to the memory structure of the JVM and the GC, in the event of a memory leak or overflow problem, the troubleshooting work will become extremely difficult. 1. Run-time data region Java
Part III Virtual machine execution subsystemChapter 6th class file StructureThe basis of language independence is still the virtual machine and bytecode storage format, using the Java compiler can compile Java code into a storage
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.