exceptions to the Java Virtual machine are represented by an instance of Throwable or its subclasses, which is actually a real-time, non-local (nonlocal) conversion of the control of the program-from where the exception is thrown to where it handles the exception. The vast majority of exceptions are caused by an operation that is performed by the current thread,
"Survival or death" how to determine whether the object is alive? Two algorithms are given in this paper, namely, the reference counting algorithm and the accessibility analysis algorithm.
Reference counting algorithm
The idea of the algorithm is simple and easy to implement. We add a reference counter to the object, and when there is a place to reference it, the reference counter adds one, and when the reference fails, the counter is reduced by one, and when the counter is 0 o'cloc
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
I. INTRODUCTIONJava's memory management and garbage collection is the same problem in some way. For Java programmers, with the help of the virtual machine automatic memory management mechanism, it is not necessary to write the paired Delete/free code for each new operation, which is not prone to memory leaks and memory overflow problems, and the
The so-called virtual machine, is a virtual machine. Ta It is a software used to execute a series of virtual computer instructions, in general virtual machines can be divided into system virtu
virtual machine class loading mechanism : the virtual machine loads the data of the description class from the class file into the memory, verifies the data, parses and initializes it, and eventually forms a Java type that can be used directly by the
I. Program storage format
Unified Program Storage Format: virtual machines on different platforms are uniformly using the program storage format-byte code (bytecode) in all platforms;
The Java Virtual machine does not care about the source of the class file, but only the "class file" binary file format, wh
In Java application development process, we often encounter OutOfMemoryError exception, do not know what is the reason, at this time we need to know the Java memory model, find some information, the Java memory model summarized; Java memory structure, which is the data area at runtime
Java Heap Overflow:When testing in eclipse, you can set virtual machine parameters in Debug/run, such as -xmx 20M represents the maximum VM heap memory size is 20M,-xms is the smallest heap memory . And then write a dead loop. The class constantly adds objects to the list collection, and when the heap memory exceeds 20M, the outofmemory exception is reported.
Because the Java virtual machine contains heap memory, method area, virtual machine stack, local method stack and program counter five parts, wherein the program counter is the only piece of memory that does not occur the memory overflow exception, so only four memory areas
Java Virtual Machine (JVM) is a hypothetical computer that can run Java code. As long as the interpreter is transplanted to a specific computer according to the JVM Specification Description, it can ensure that any compiled Java code can run on the system. This article first
Java Virtual Machine (JVM) is a hypothetical computer that can run Java code. As long as the interpreter is transplanted to a specific computer according to the JVM Specification Description, it can ensure that any compiled Java code can run on the system. This article first
execution.Load:The load phase is a phase in the class loading mechanism, which is often referred to as "loading," and is mainly done by:1. Obtain a binary byte stream that defines this class by "full name of Class"2. Convert the static storage structure represented by the byte stream to the run-time data structure of the method area3. Generate a Java.lang.Class object representing this class in the Java heap as the access entry for the data in the me
1. Run-time data area
1.1 Program Counters
The program counter is a thread-isolated area where each thread has a separate program counter.
It is a small amount of memory space, the bytecode interpreter by changing the counter to select the next byte code instruction to execute, branch, loop, jump, exception handling, thread recovery and other basic functions need to rely on it to complete.1.2 Java Virtual
What is 1.JVM? Jvm:java virtual mechinal (Java vm). It is a fictional computer that is implemented by simulating various functions on a real computer. The main task of the JVM is to interpret its own set of instructions (bytecode, such as Java source code compiled into a class file to run on a virtual
1. Composition of the Java memory areaThe memory of the Java Virtual Runtime is mainly composed of five parts:(1) Method areaThe method area is used to store data such as class information, constants, static variables, and so on, that are loaded by the virtual machine. The s
Java card Virtual Machine (jcvm) Specification defines JavaProgramA subset of the design language and a Java-compatible Virtual Machine for smart cards, including binary data representation and file formats, and jcvm instruction s
In C + +, programmers have ownership of each object, but at the same time shoulder the responsibility of releasing the object's memory space, while Java has the help of a virtual machine, the programmer has ownership of the object and no longer need to free the object's memory space. Because the JVM automatically frees up object memory, memory leaks and memory ov
Java memory Area run-time data regionProgram counter (Counter Register)
A smaller memory space is an indicator of the line number of the bytecode that is being executed by the current thread. The bytecode interpreter obtains the next bytecode instruction by changing the value of the counter, branching, looping, jumping, exception handling, and thread recovery are done by it.
Each thread has its own counter, and the counters between the th
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.