Discover 1 8 java virtual machine, include the articles, news, trends, analysis and practical advice about 1 8 java virtual machine on alibabacloud.com
loaded.In addition to the constants generated at compile time, it is also possible to generate dynamically, such as The Intern () of the String class.1.7 Direct MemoryIn JDK 1.4, new NIO classes are added, which can be used to directly allocate out-of-heap memory (Native heap) using the Native Library, and then operate through a Directbytebuffer object stored in the Java heap as a reference to this memory.This can significantly improve performance in
Read deep understanding of Java Virtual Machine-Part 1: Structure of the Class file,
1. Generate
Source code (. java file) --> Compiler (such as javac) --> bytecode (. class file) --> Virtual
) { return (a + b) * (a - b); } public static void main(String[] args) { Hello t = new Hello(); System.out.print(t.foo(5, 3)); }}
Take the foo method in this Code as an example. After compiling it into a class file, decompile the class file to view the JAVA bytecode:
Code: 0: iload_1 1: iload_2 2: iadd 3: iload_1 4: iload_2 5: isu
One: Java technology system module diagramJava Technology Architecture Module diagramTwo: JVM Memory area model
1. Method areaAlso known as "permanent generation", "non-heap", it is used to store virtual machine loaded class information, constants, static variables, is the memory area shared by each thre
registers. In addition, the stack-based architecture of Java virtual machine also helps some virtual machines to achieve dynamic compiler and real-time compiler code optimization during runtime.
It depicts the memory areas created by the Java
Program
Java runtime data zone:
A. Method Area ----------- (common threads)
B. Heap --------- (threads in total)
C. Virtual Machine stack --------- (thread private)
D. Local method stack ----------- (thread private)
E. Program counters --------- (thread private)
Note:
A. The thread is private. That is to say, each thread has A zone such as C, D, and E, so that it
. Start as complete as SUNJDK. Also note that OpenJDK only contains the most streamlined JDK, and if the OpenJDK of the Icetea patch is used, OpenJDK command "java-version" displays not OpenJDK, but Java.Two installation Environment Preparation This article is selected in the VirtualBox, using the Ubuntu 14.04 32-bit version of the image, the main system is Ubuntu 16.04 64, why I was the real machine is Ubu
Program
Java runtime data zone:
A. Method Area ----------- (common threads)
B. Heap --------- (threads in total)
C. Virtual Machine stack --------- (thread private)
D. Local method stack ----------- (thread private)
E.ProgramCounter ----------- (thread private)
Note:
A. The thread is private. That is to say, each thread has a zone such as C, D, an
initialization by completing the initialization of the static variable and static code block of the class. Examples are as follows:The classes that need to be loaded Reflect.java as follows: Public classReflect {Private intUserName; Private intpassword; Static{System.out.println ("Reflect static Block"); } PublicReflect () {System.out.println ("Reflect Constructs"); } Public intGetUserName () {returnUserName; } Public voidSetusername (intuserName) { This. UserName =UserName; }
1. PrefaceThere are several more important concepts that need to be popularized before garbage collection.2. Concepts and differences in memory overflow and memory leaks:(1): Memory overflow: Refers to the program in the application of memory, there is not enough memory space to allocate, the system can not meet the requirements, there is an out of memory; for example, an int was applied, but it saved a lon
Deep understanding of Java Virtual Machine-learning notes and deep understanding of Java Virtual Machine
JVM Memory Model and partition
JVM memory is divided:
1.Method Area: A thread-sh
can be performed after the initialization stage in some cases to support dynamic binding of the java language.
Virtual Machine specifications strictly stipulate that class initialization must be performed immediately in five cases: (called active reference to class)
(1) When four bytecode commands, namely new, getstat
deep understanding of the Java Virtual Machine.3. Data Types supported by Java Virtual MachineJava Virtual Machine supports the following basic data types:Byte: // complement of a sign
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.