当前位置:网站首页>JVM (24) -- performance monitoring and tuning (5) -- Analyzing GC logs
JVM (24) -- performance monitoring and tuning (5) -- Analyzing GC logs
2022-07-28 20:07:00 【leo_ messi94】
1. GC Log format
1.1 review :GC classification

Cenozoic collection : When Eden When the area is full, the Cenozoic collection will be carried out , So the Cenozoic collection and S0 Areas and S1 Region independent
The relationship between the old generation collection and the new generation collection : The garbage collection of the younger generation will be carried out before the collection of the older generation , Here's why : A relatively large object cannot be put into the Cenozoic , Then it will naturally go back to the old age , If the old generation can't let go , It will first carry out a new generation of garbage collection , Then try to put... Into the Cenozoic , If you still can't put it down , For the old garbage collection , Then I put it in the old days , This is a process , Let me explain why we need to release them to the elderly , But I can't let go , The reasons for the new generation of garbage collection , This is because the new generation of garbage collection is simpler than the old generation , This saves performance
During garbage collection , The heap contains Cenozoic 、 Old age 、 Meta space / Forever : It can be seen that Heap It includes the Cenozoic 、 Old age 、 Meta space , But when we set the heap size, we only set the new generation 、 It's just the old generation , Meta spaces are set up separately 
1.1.1 What will trigger Full GC:
- There is not enough space in the old age
- Insufficient method space
- Display call System.gc()
- Minior GC The average size of data entering the old age is larger than the available memory of the old age
- Large objects go directly into the old generation , There is not enough space available in the old age
1.2 GC Classification of log
1.2.1 MinorGC


1.2.2 FullGC


1.3 GC Analysis of log structure
1.3.1 Garbage collector

1.3.2 GC Before and after

1.3.3 GC Time

1.4 Minor GC Log parsing
Log data :
2020-11-20T17:19:43.265-0800: add to -XX:+PrintGCDateStamps Parameters . Log printing time Date format Such as 2013-05-04T21:53:59.234+08000.822: add to -XX:+PrintGCTimeStamps This parameter gc occurs ,Java The number of seconds since the virtual machine started[GC(Allocation Failure): There was a garbage collection , This is a time Minior GC. It does not distinguish between the new generation and the old generation GC, The content in brackets is gc What happened , there Allocation Failure The reason is that there is not enough area in the Cenozoic to store the data to be allocated and fail[PSYoungGen:76800K->8433K(89600K):PSYoungGen: Express GC Where it happened , The area name and the used GC Collectors are closely related- Serial The collector :Default New Generation Show Defnew
- ParNew The collector :ParNew
- Parallel Scanvenge The collector :PSYoung
- The new generation is the same as the old generation , It is also related to the collector name
76800K->8433K(89600K):GC The memory area was previously used ->GC Rear cover area capacity ( The total capacity of the area )- If it's the new generation , The total capacity will show the total capacity of the whole Cenozoic memory 9/10, namely eden+from/to District
- If it's an old age , The total capacity is the total memory size , unchanged
76800K->8449K(294400K): Although this time is Minor GC, Only the new generation of garbage collection , But it will also print information about the total capacity in the heap . After displaying the area capacity GC After the situation , The entire heap memory area will then be displayed GC situation :GC Used capacity of front heap memory ->GC Post heap memory capacity ( Total heap memory capacity ), And the total capacity of heap memory = 9/10 The new generation + Old age , Then the total capacity of heap memory must be less than the initialized memory size,0.0088371: Whole GC The time it takes , The unit is seconds[Times:user=0.02 sys=0.01,real=0.01 secs]- user: finger CPU Time spent working in user mode
- sys: finger CPU Time spent working in kernel state
- real: Refers to the total time spent in this event
1.5 Full GC Log parsing
Log data :
2020-11-20T17:19:43.794-0800: add to -XX:+PrintGCDateStamps Parameter log printing . Time Date format Such as 2013-05-04T21:53:59.234+08001.351: add to -XX:+PrintGCTimeStamps This parameter .gc occurs ,Java The number of seconds since the virtual machine startedFull GC(Metadata GCThreshold): There was a garbage collection , This is a time Full GC. It does not distinguish between the Cenozoic GC Or the old generation GC. In parentheses is gc What happened , reason :Metaspace There's not enough space . besides , There are two other situations that can cause Full GC, as follows :Full GC(FErgonomics): reason :JVM Adaptive adjustment leads to GCFull GC(System): reason : Called System.gc() Method
[PSYoungGen: 100082K->0K(89600K)]:PSYoungGen: Express GC Where it happened , The area name and the used GC Collectors are closely related :- Serial The collector :Default New Generation Show DefNew
- ParNew The collector :ParNew
- Parallel Scanvenge The collector :PSYoungGen
- The new generation is the same as the old generation , It is also related to the collector name
10082K->0K(89600K):GC The memory area was previously used ->GC Capacity of this area ( The total capacity of the area )- If it's the new generation , The total capacity will show the total capacity of the whole Cenozoic memory 9/10, namely eden+from/to District
- If it's an old age , The total capacity is the total memory size , unchanged
ParOldGen:32K->9638K(204800K): The old age area did not happen GC, So this time GC yes metaspace Caused by the10114K->9638K(294400K): After displaying the area capacity GC After the situation , The entire heap memory area will then be displayed GC situation :GC Used capacity of front heap memory ->GC Post heap memory capacity ( Total heap memory capacity ), And the total capacity of heap memory = 9/10 The new generation + Old age , Then the total capacity of heap memory must be less than the initialized memory size[Meatspace:20158K->20156K(1067008K)]:metaspace GC Recycling 2K Space,0.0285388: Whole GC The time it takes , The unit is seconds[Times:user=0.11 sys=0.00,real=0.03 secs]- user: finger CPU Time spent working in user mode
- sys: finger CPU Time spent working in kernel state
- real: Refers to the total time spent in this event
2. GC Log analysis tool


A little , Watch videos
边栏推荐
- [网络]跨区域网络的通信学习IPv4地址的分类和计算
- [C language] guessing numbers game [function]
- Data system of saltstack
- 11. Learn MySQL union operator
- Token verification program index.php when configuring wechat official account server
- [in depth study of 4g/5g/6g topics -44]: urllc-15 - in depth interpretation of 3GPP urllc related protocols, specifications and technical principles -9-low delay technology -3-non slot scheduling mini
- JS preventdefault() keyboard input limit onmousewheel stoppropagation stop event propagation
- Source insight project import and use tutorial
- Andorid system layout, values, drawable adaptation
- C+ + core programming
猜你喜欢

editor.md中markdown编辑器的实现

基于 MinIO 对象存储保障 Rancher 数据

数字图像理论知识(一)(个人浅析)
![[C language] step jumping problem [recursion]](/img/0c/32870484e89b494e41068f7c38b08e.png)
[C language] step jumping problem [recursion]

How to write the SQL statement of time to date?

Advanced notes (Part 2)

云计算笔记part.1——系统管理

个人博克系统登录点击图形验证码的集成与实现

Kubeedge releases white paper on cloud native edge computing threat model and security protection technology

Use Hal Library of STM32 to drive 1.54 inch TFT screen (240*240 st7789v)
随机推荐
Design of air combat game based on qtgui image interface
[network] communication across regional networks learn how routing tables work
Integration and implementation of login click graphic verification code in personal blog system
Redis notes
Token verification program index.php when configuring wechat official account server
Getting started with enterprise distributed crawler framework
Data system of saltstack
leetcode day3 超过经理收入的员工
C language pointer and two-dimensional array
[C language] summary of methods for solving the greatest common divisor
3、 Are formal and actual parameters in a programming language variables?
[C language] Gobang game [array and function]
[C language] function
Implementation of memmove in C language
河北邯郸:拓展基层就业空间 助力高校毕业生就业
云原生编程挑战赛火热开赛,51 万奖金等你来挑战!
Sequential linear table - practice in class
Digital filter design matlab
Cloud computing notes part.2 - Application Management
Common APIs in string