In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
JVM garbage collector parameter configuration process, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
When it comes to JVM, many people think it is a very profound thing. But there is nothing mysterious about it, we just need to remember some of its parameters and configuration manual. This article will introduce some of the parameter usage of JVM in detail.
UseSerialGC: enable this parameter to use the serial & serial old collector (the default for client mode).
UseParNewGC: enable this parameter to use the ParNew & serial old collector (not recommended).
UseConcMarkSweepGC: enable this parameter and use the ParNew & CMS (serial old is the substitute) collector.
UseParallelGC: enable this parameter to use the parallel scavenge & parallel old collector (the default for server mode).
UseParallelOldGC: enable this parameter to use the parallel old collector in the older generation (this parameter is no longer useful after JDK1.5).
Parameters related to the size of each memory area of JVM
Xms: the initial value of the heap. The default is 64 seconds of physical memory, and the maximum is no more than 1G.
Xmx: maximum value of the heap. The default is 1 stroke 4 of physical memory, and the maximum is no more than 1G.
Xmn: the size of the new generation.
Xss: thread stack size.
PermSize: the initial size of the permanent generation. The default is 64 seconds of physical memory, and the maximum is no more than 1G.
MaxPermSize: the maximum value of the permanent generation. The default is 1 stroke 4 of physical memory, and the maximum is no more than 1G.
NewRatio: the ratio of the new generation to the old generation. For example, if it is 3, the Cenozoic generation occupies 1max 4, and the older generation accounts for 3max 4.
SurvivorRatio: adjust the ratio of eden to survivor in the Cenozoic era. The default is 8, that is, the size of the eden area is 80%, and the size of the two survivor is 10% respectively. Note: this parameter setting is the solution to halving the memory of the replication algorithm in the chapter on replication algorithms. The eden area is the 80% part of the replication algorithm chapter, while the survivor area is the part of the two 10%. )
General performance parameters of garbage collector
PretenureSizeThreshold: the size of the object for promotion to the older generation. The default value is 0, for example, if it is set to 10m, the objects over 10m will not be allocated in the Eden area, but will go directly to the older generation.
MaxTenuringThreshold: the maximum age for promotion in the old age. The default is 15, for example, if it is set to 10, the object will be put into the older generation after 10 normal GC.
DisableExplicitGC: disable System.gc ().
Parallel collector parameters
ParallelGCThreads: the number of threads turned on during recycling. The default is equal to the number of CPU.
GCTimeRatio: sets the throughput of the system. For example, if it is set to 99, the GC time ratio will be 1 / 99 / 99 / 1, which means the required throughput is 99%. If it can not be satisfied, it will reduce the size of the new generation.
MaxGCPauseMillis: sets the maximum pause time for garbage collection. If the setting value is not met, the size of the new generation will be reduced first, and the throughput will be sacrificed if it is still not satisfied.
Concurrent collector parameters
CMSInitiatingOccupancyFraction: the memory ratio that triggers the CMS collector. For example, 60% means that when the memory reaches 60%, CMS concurrent collection will begin.
UseCMSCompactAtFullCollection: as mentioned earlier, it is used to clean up the memory every time the CMS collector cleans up the garbage.
CMSFullGCsBeforeCompaction: set to trigger a memory consolidation after several CMS garbage collections.
After reading the above, have you mastered the method of configuring the parameters of the JVM garbage collector? 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: 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.