当前位置:网站首页>Use jpofiler tool to analyze the cause of OOM
Use jpofiler tool to analyze the cause of OOM
2022-07-21 19:32:00 【Kuxiaoya】
List of articles
In a project , Pop up OOM fault , So how to eliminate - Study why something went wrong -
You can see the error in the first few lines of the code : Memory snapshot analysis tool ,MAT,Jprofiler( recommend )
Debug, Analyze the code line by line
MAT,Jprofiler effect :
- analysis Dump Memory files , Quickly locate memory leaks
- Get the data in the heap
- Get big objects
…
download JProfiler plug-in unit
After installing the plug-in , Make sure you reboot !
download Jprofiler Software
Download address :http://www.xue51.com/soft/12717.html#xzdz Without brains, the next step is !
It is best to customize the path ~
Plug in connection software
Start testing
1、 add to VM Options
Explanation of command code :
-Xms1m -Xmx8m -XX:+HeapDumpOnOutOfMemoryError
- -Xms :
Set the initialization memory allocation size
- -Xmx :
Set the maximum allocated memory
, Default -XX:+PrintGCDetails
: Print GC Garbage collection information-XX:+HeapDumpOnOutOfMemoryError
: OOM DUMP
2、 Test code
import java.util.ArrayList;
public class Demo {
public static void main(String[] args) {
ArrayList<Demo> list = new ArrayList<>();
int count = 0;
try {
while(true){
list.add(new Demo());// utilize JPofiler Tools , You can find out the problem of this line of code
count = count +1;
}
} catch (Exception e) {
System.out.println("count"+count);
e.printStackTrace();
}
}
}
3、 Find the generated file
4、 Analyze faults
Although I know there is something wrong with the big object , How do we know which line of code is wrong ?
So let's look down ~
边栏推荐
- L1-008 求整数段和
- Introduction to ESP privilege isolation mechanism
- 分布式.高并发&高可用
- Metahuman Face材质球总结
- Software testing interview question: what is the difference between quotation and pointer?
- Tencent im practice: low code and ultra fast instant address book
- MYSQL09_ Elaborate on database data types
- Verilog语法基础HDL Bits训练 03
- Clickhouse in-depth disclosure
- Preparation of hemoglobin albumin nanoparticles encapsulated by Lumbrokinase albumin nanoparticles / erythrocyte membrane
猜你喜欢
C what are the output points of DSP core resample of digital signal processing toolkit
45、记录训练OrienMask过程和部署运适科技深度相机过程
深度学习—— (5)数据不平衡之class_weight
Introduction to ESP privilege isolation mechanism
Test de pénétration - vulnérabilité d'inclusion de fichiers et application de pseudo - protocoles PHP
建议收藏 | 可实操,数据中台选型示例
List容器的系列操作( 详解 )
Solve the error: uncaught typeerror: cannot read properties of undefined (reading 'install')
Distributed High concurrency & high availability
分布式.BASE理论
随机推荐
Software test interview question: briefly describe what you have done in your previous work and what you are familiar with. The reference answers are as follows.
Strcspn, strchr special character verification
Interview 02
Distributed Cap theory
四种bean拷贝工具对比
其他正则验证规则web launch app
Preparation of hemoglobin albumin nanoparticles encapsulated by Lumbrokinase albumin nanoparticles / erythrocyte membrane
FPGA逻辑资源评估之BRAM(以Xilinx为例)
MYSQL06_ Seven join operations and union all of sql99
C语言学习
OSPF Foundation
[qt primer] Application of window classes
Detailed explanation of at mode principle of Seata (3)
Distributed What index is high concurrency
L1-008 求整数段和
Model模态框点击其他除了模态框区域不消失
分布式.BASE理论
Verilog grammar basics HDL bits training 03
Distributed Base theory
Recommended collection | practical operation, data console selection example