当前位置:网站首页>GC log analysis
GC log analysis
2022-06-09 03:43:00 【seven billion two hundred and fifty-eight million two hundred a】
Catalog
One 、 Log printing
1.JVM Add a parameter in
‐Xloggc:./gc‐%t.log ‐XX:+PrintGCDetails ‐XX:+PrintGCDateStamps ‐XX:+PrintGCTimeStamps ‐XX:+PrintGCCause ‐XX:+UseGCLogFileRotation ‐XX:NumberOfGCLogFiles=10 ‐XX:GCLogFileSize=100M
2.Tomcat Add to JAVA_OPTS variable
Two 、GC Log analysis Demo
A local service , The parameters are as follows :
java -jar -Xloggc:./gc-%t.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M .\microservice-eureka-server.jar

Project start , open the log file , The contents are as follows :
Configuration parameters of the project
Not only is printing configured here GC journal , And related VM Memory parameters .
GC Situation analysis 
2022-06-04T14:42:00.589+0800: 2.829: [Full GC (Metadata GC Threshold) [PSYoungGen: 4997K->0K(129024K)] [ParOldGen: 2890K->7520K(94720K)] 7887K->7520K(223744K), [Metaspace: 20864K->20864K(1069056K)], 0.0381591 secs][Times: user=0.16 sys=0.00, real=0.04 secs]
1、2.829 : from jvm Start the calculation to this time GC Time passed
2、Full GC(Metadata GC Threshold): This is a time full gc, In brackets is gc Why , PSYoungGen It's the younger generation GC, ParOldGen It's from the old days GC,Metaspace It's the of meta space GC.
3、[PSYoungGen: 4997K->0K(129024K)] : The three numbers correspond to GC It used to occupy the size of the younger generation ,GC Later, the younger generation occupied , And the whole young generation Small .
4、[ParOldGen: 2890K->7520K(94720K)] : The three numbers correspond to GC It used to occupy the size of the old age ,GC Later, the old age occupied , And the size of the whole old age .
5、7887K->7520K(223744K): The three numbers correspond to GC The size of the heap memory previously occupied ,GC After that, the heap memory is occupied , And the entire heap memory Size .
6、[Metaspace: 20864K->20864K(1069056K)]: The three numbers correspond to GC The size of the memory that used to occupy meta space ,GC After that, the meta space memory is occupied , With And the size of the entire Metaspace memory .
7、0.0381591 secs: This point in time GC It takes time
Optimize
From the log, you can find fullgc It is caused by insufficient meta space , So we can turn up the meta space .
java -jar -Xloggc:./gc‐adjust-%t.log ‐XX:MetaspaceSize=256M ‐XX:MaxMetaspaceSize=256M -XX:+PrintGCDetails -XX:+PrintGCDateStamps ‐XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M .\microservice-eureka-server.jar
Let's take a look after the adjustment gc The log finds that there are no problems caused by insufficient meta space fullgc 了
3、 ... and 、gceasy visualization GC journal
Upload gc The file uses a visual interface to show GC situation
Official website address :https://gceasy.io/
Put the GC Log file import analysis
1、 You can see the younger generation 、 Old age 、 And the memory allocation and maximum usage of the permanent generation .
2、 You can see that there is GC Before and after changes and other information 
Four 、JVM Parameter summary view command
Print out the default values of all parameter options
java -XX:+PrintFlagsInitial
Print out the values of all parameter options that take effect when the program is run
java -XX:+PrintFlagsFinal
This article is for study and exchange only , Deletion of infringement contact .
边栏推荐
- 故障分析 | MySQL 中新建用户无法登陆的一种特殊场景
- Opencv learning notes 1
- SAS batting lab demonstrates the value of data and analysis to teenagers
- Detailed explanation of HLS live broadcast protocol m3u8
- The El cascader code cancels the selection and manually deletes an item
- WebRTC介绍及简单应用
- Experts, how to quickly transform managers?
- 并发操作之——ReenTrantLock和synchronized的区别
- Wwdc2022 interesting news Apple released the free weather API weatherkit
- Scala - numerical characteristic bucket
猜你喜欢

Indonesia widya robotics and Huawei cloud make the safety of construction sites visible

85. (leaflet house) leaflet military plotting - line arrow drawing

What is the value of Yuan universe virtual real estate?

After 15000 interns joined Amazon, what was life like in the big factory?

GC日志分析

Vivado HLS int8/9 multiplication optimization

85.(leaflet之家)leaflet军事标绘-直线箭头绘制

控制台输入命令 net start mysql 控制台输出系统发生错误 5。 拒绝访问。MySQL 服务正在启动.MySQL 服务无法启动。服务没有报告任何错误。请键入 NET HELPMSG 353

Runtime constant area - Method area

How to calculate the number of parameters in the LSTM layer
随机推荐
Redis6 learning notes - Chapter 1 - Introduction and environment construction of redis
The El cascader code cancels the selection and manually deletes an item
How to use superset to seamlessly connect with MRS for self-service analysis
Neural network learning (IV) -- a simple summary of the knowledge of each layer of neural network
Customized development of blind box app system
Practical combat of Youku terminal side bullet screen piercing technology: pixelai mobile terminal real-time portrait segmentation
Fault analysis - a case of excessive CPU load caused by a large number of short-time processes
Common Android program functions clear cache
VGA display of color bar, character and picture based on FPGA
软件工程期末考试试题及答案(详细、经典)
Laravel determines whether the mailbox already exists and verifies whether the mailbox format is legal
神经网络学习(四)----神经网络各层知识的简单总结
It becomes obsolete when you use it ~websecurityconfigureradapter
85. (leaflet house) leaflet military plotting - line arrow drawing
并发操作之——BlockingQueue
Solve the problem that the MySQL library or table is stuck during deletion and other operations
C#.net调用动态库dll注意事项
Cereals mall -day13- goods on the shelves
Method of accessing LAN by external network and how virtual machines installed by VM access each other in LAN
Error 1130- host XXX is not allowed to connect to this MariaDB server