In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
1. Metaspace:
The essence of meta-space is similar to that of permanent generation, which is the realization of the legal area in the JVM specification. However, the biggest difference between metaspace and permanent generation is that metaspace is not in the virtual machine, but uses local memory. Therefore, by default, the size of metaspace is limited only by local memory.
However, you can specify the size of the metaspace with the following parameters:
-XX:MetaspaceSize=N
This parameter is the initialized Metaspace size, and the higher the value, the later the Metaspace GC will be triggered. With the advent of GC, virtual machines regulate the size of Metaspace according to the actual situation, which may increase or decrease. By default, this value fluctuates from 12m to 20m depending on the platform. Use the java-XX:+PrintFlagsInitial command to view the native initialization parameters, and the-XX:Metaspacesize is 21810376B (about 20.8m).
-XX:MaxMetaspaceSize=N
This parameter is used to limit the upper limit of Metaspace growth to prevent Metaspace from using local memory indefinitely due to certain circumstances, affecting other programs. The default value of this parameter on this machine is 4294967295B (approximately 4096MB).
-XX:MinMetaspaceFreeRatio=N
After Metaspace GC, the free space ratio of the current Metaspace is calculated, and if the idle ratio is less than this parameter, the virtual machine will increase the size of the Metaspace. On this machine, the default value of this parameter is 40, that is, 40%. Setting this parameter can control the growth rate of Metaspace, too small value will lead to slow growth of Metaspace, and the use of Metaspace tends to be saturated, which may affect the loading of classes later. Too large a value will cause Metaspace to grow too fast, wasting memory.
-XX:MaxMetasaceFreeRatio=N
After the Metaspace GC, the free space ratio of the current Metaspace is calculated, and if the free space ratio is greater than this parameter, then the virtual machine frees up part of the space of the Metaspace. On this machine, the default value of this parameter is 70, that is, 70%.
-XX:MaxMetaspaceExpansion=N
The largest increase in Metaspace. The default value for this parameter on this machine is 5452592B (approximately 5MB).
-XX:MinMetaspaceExpansion=N
The minimum amount of Metaspace growth. On this machine, the default value of this parameter is 340784B (approximately 330KB).
two。 Meta-space memory management
The memory management of metaspace is accomplished by metaspace virtual machine. Previously, we needed different garbage collectors to process the meta-data of the class, but now we only need to execute the C++ code of the metaspace virtual machine.
In metaspace, the life cycle of a class and its metadata is the same as its corresponding class loader.
In other words, as long as the classloader survives, the metadata of the class it loads is also alive, so it will not be recycled.
To be exact, the storage area of each class loader is called a meta-space, and all the meta-spaces together are what we always call meta-space.
When a class loader is marked by the garbage collector as no longer alive, its corresponding metaspace is reclaimed.
Please refer to the article:
Https://blog.csdn.net/bolg_hero/article/details/78189621
Https://www.cnblogs.com/williamjie/p/9558136.html
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.