In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Today, I will talk to you about how to form a JVM memory structure. Many people may not know much about it. In order to let you know more, Xiaobian summarizes the following contents for you. I hope you can gain something according to this article.
If you know about JVM memory structure, share it with you here. JVM memory structure mainly includes two subsystems and two components. These two components are Runtime dataarea component and Native interface component respectively.
JVM memory structure
Recently looked at some cases of Java memory leakage, discussed with several of the original buddies, in-depth research found that there are still many details that were not known before, here is a little analysis. Let's take a look at the JVM internals--
As shown in the figure, the JVM memory structure consists primarily of two subsystems and two components. The two subsystems are the Classloader subsystem and the Execution Engine subsystem; the two components are the Runtime Data Area component and the Native Interface component.
The Classloader subsystem:
Load the contents of the class file into the methodarea of the Runtimedataarea based on the given fully qualified class name (e.g. java.lang.Object). Java programmers can write their own Classloaders using the extendsjava.lang.ClassLoader class.
The Executionengine subsystem:
Execute instructions in classes. At the heart of any JVM specification implementation (JDK) is the Execution Engine, and different JDKs such as Sun's JDK and IBM's JDK are primarily determined by the quality of their respective implementations of the Execution Engine.
Nativeinterface component:
Interaction with nativelibraries is an interface to other programming languages. When the native method is called, you enter a whole new world that is no longer constrained by virtual machines, so it is also easy to have nativeheapOutOfMemory that the JVM cannot control.
RuntimeDataArea component:
This is what we call JVM memory. It's divided into five parts--
Heap: There is only one heap space in a Java virtual instance.
MethodArea: The information of the loaded class is stored in the memory of MethodArea. When the virtual machine loads a type, it uses the class loader to locate the corresponding class file, then reads the class file contents and transfers it to the virtual machine.
Java Stack: The virtual machine performs only two operations directly on Java Stack: frame pushing or popping.
ProgramCounter: Each thread has its own PC register, which is also created when the thread starts. The contents of the PC register always point to the address of the next instruction to be executed, either as a local pointer or as an offset in the method field corresponding to the instruction that started the method.
Nativemethodstack: Save the address of the native method entry area
Only Heap and MethodArea are shared by all threads, while Javastack,Programcounter and Nativemethodstack are thread-granular, with each thread having its own section.
After reading the above, do you have any further understanding of how to make up JVM memory structure? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.