Summary after reading Java Virtual Machine (1) JVM Memory Model

Source: Internet
Author: User

Summary after reading Java Virtual Machine

1) Sun HotSpot JVM Memory Model

2) Sun HotSpot JVM Memory Allocation

Iii) Sun HotSpot JVM memory monitoring

4) Sun HotSpot JVM garbage collection

 

Based on Sun HotSpot JVM


Direct:

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; cursor: default; border-right: 0px "src =" http://www.bkjia.com/uploads/allimg/131228/113A4Nb-0.jpg "width =" 526 "height =" 275 "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/113A4Nb-0.jpg "/>


The JVM memory is divided into two main areas: one is the data zone shared by all threads, and the other is the thread isolation data zone. The thread is private)


Thread isolation data Zone

Program Counter (Program Counter Register ):
A small memory space, the bytecode line number indicator executed by a single front thread. When the bytecode interpreter is working, you can change the value of this counter to select the next bytecode instruction to be executed, this counter is required for basic functions such as branch, loop, jump, exception handling, and thread recovery.

JVM Virtual Machine stack (Java Virtual Machine Stacks ):
The Java method execution memory model is used to store information such as local variables, operand stacks, dynamic links, and method exits. It is thread-proprietary.

Native Method Stacks ):
For Native METHOD services used by JVM, Sun HotSpot combines the local method stack with the JVM Virtual Machine stack. It is thread-proprietary.


Data area shared by threads

Method Area ):
It is used to store information about classes loaded by JVM, constants, static variables, and even compiled code by the compiler.
Runtime Constant Pool ):
Is a part of the Method Area, used to store various literal and symbolic references generated by the compiler. This part of content will be stored in the Method Getting runtime constant pool after the class is loaded. It is dynamic and uses the intern () method of the String class.
JVM Heap Java Virtual Machine Heap ):
Where all object instances are stored.
New generation, composed of Eden Space and two same-size vor segments
Old waiting, storing objects that are still alive after multiple garbage collection

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; cursor: default; border-right: 0px "src =" http://www.bkjia.com/uploads/allimg/131228/113A43305-2.jpg "width =" 464 "height =" 182 "data-mce-src =" http://www.bkjia.com/uploads/allimg/131228/113A43305-2.jpg "/>


Direct Memory ):
It is not part of the data zone during virtual machine running, nor is it the memory zone defined in Java Virtual Machine specifications. The NIO class is added to JDK1.4, and a Channel-based Buffer I/O method is introduced. It can be used to directly allocate off-heap memory using the Native function library, then, use a DirectByteBuffer object stored in the JAVA heap as a reference to the memory. This can significantly improve performance in some scenarios, because it avoids repeated data replication between the JAVA heap and the Native heap.





This article is from the "AUB" blog, please be sure to keep this source http://aubdiy.blog.51cto.com/2978849/1207517

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.