In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to understand the Java memory area, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Java memory partitioning:
In Java memory allocation, java divides memory into method area, heap, virtual machine stack, local method stack, and program counter. The method area and heap are shared for all threads, while the virtual machine stack and the local method stack have program counters isolated for threads. Each area has its own creation and destruction time.
Program counter:
The function is a line number indicator of the bytes executed by the current thread. The multithreading of Java is realized by thread switching in turn and allocating processor execution time. Therefore, in order for each thread to recover to the correct location after switching, each thread needs a separate program counter.
Java virtual machine stack:
Each time it is executed, a stack frame is created to store local variables, Operand stacks, dynamic links, method exits, and so on. Virtual memory stack is what we often call "stack". Among them, the memory required by the local variable table is allocated at the compilation time.
Local method stack: similar to the virtual machine stack, except that the virtual machine stack performs Java method services for the virtual machine, while the local method stack uses Native method services for the virtual machine.
Java heap:
It is shared by all programs and created when the virtual machine starts. The purpose of this memory area is to hold the object instance. According to the Java virtual machine, the Java heap can be in physically discontiguous memory space, as long as it is logically continuous.
Method area:
Like the heap, it is shared between threads. The function is to store class information, constants, static variables, compiled code and other data that have been loaded by the virtual machine.
Run time Pool:
Is part of the method zone. The function is to store various literals and symbolic references generated at compile time.
After reading the above, have you mastered how to understand the memory area of Java? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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: 229
*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.