Discover java 1 7 virtual machine, include the articles, news, trends, analysis and practical advice about java 1 7 virtual machine on alibabacloud.com
. Hello to get the Java bytecode of the foo () function:
Public int foo (int, int); Code: 0: iload_1 # int (Operation Type) load (save local variables to the Java stack) the number on the right of the underline indicates the specific local variable for the operation (the index value starts from 0) 1: iload_2 2: iadd # Two int type values are added from the top of
Stackoverflowerror and OutOfMemoryError like the virtual machine stackThe fourth one is the Java heap:Created when the virtual machine is started, with the sole purpose of storing the object instance. Almost all of the object instances are allocated memory here. The
in the JDK1.8 is completely removed, instead of the metadata area, the metadata area is a heap of memory, unlike the persistence zone, if the metadata area size is not specified, the virtual opportunity consumes the system memory until it runs out.1.7. Local Method StackThe local method stack is very similar to the Java stack, and the biggest difference is that the Jav
Java Virtual Machine (1) Automatic Memory Management MechanismJava memory overflow exceptionI. Summary
We can learn with the following questions:Automatic Memory Management Mechanism, As shown below:What operations may cause memory overflow? What types of memory overflow are there? Which areas of memory are full? What
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
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
Document directory
Program counters
Java Virtual Machine Stack
Local method Stack
Java heap
Method Area
Runtime constant pool
Direct Memory
This series provides Reading Notes for deep understanding of Java Virtual
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
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
. 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. 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
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
standard Java virtual machines (JVMS) is that the Dalvik is based on registers and the JVM is based on stacks. Another major difference between Dalvik and Java is that the operating environment is--dalvik optimized to allow instances of multiple virtual machines to run concurrently in limited memory, and each Dalvik a
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.