当前位置:网站首页>JVM family -- heap analysis
JVM family -- heap analysis
2022-07-04 03:23:00 【Li Meng LM】
One .MAT brief introduction
MAT It's an analysis tool , Installation is omitted .
Two . To configure

appear oom export dump file , Analysis report
3、 ... and . Reactor analysis
1.OOM( out of memory ) reason :
StackOverFlow Stack ,Stack Area belonging to stack , Private to each thread
HeapOutOfMemory Pile up
ConstantOutOfMemory Constant pool
DirectMemoryOutOfmemory Local memory
2. Heap overflow
public static void main(String args[]){
ArrayList<byte[]> list=new ArrayList<byte[]>();
for(int i=0;i<1024;i++){
list.add(new byte[1024*1024]);
}
}
Take up a lot of heap space , Direct spillover , resolvent : Increase heap space , Free memory in time
Generate a large number of classes
public static void main(String[] args) {
for(int i=0;i<100000;i++){
CglibBean bean = new CglibBean("geym.jvm.ch3.perm.bean"+i,new HashMap());
}
}
Caused by: java.lang.OutOfMemoryError: PermGen space
[Full GC[Tenured: 2523K->2523K(10944K), 0.0125610 secs] 2523K->2523K(15936K),
[Perm : 4095K->4095K(4096K)], 0.0125868 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]
Heap
def new generation total 4992K, used 89K [0x28280000, 0x287e0000, 0x2d7d0000)
eden space 4480K, 2% used [0x28280000, 0x282966d0, 0x286e0000)
from space 512K, 0% used [0x286e0000, 0x286e0000, 0x28760000)
to space 512K, 0% used [0x28760000, 0x28760000, 0x287e0000)
tenured generation total 10944K, used 2523K [0x2d7d0000, 0x2e280000, 0x38280000)
the space 10944K, 23% used [0x2d7d0000, 0x2da46cf0, 0x2da46e00, 0x2e280000)
compacting perm gen total 4096K, used 4095K [0x38280000, 0x38680000, 0x38680000)
the space 4096K, 99% used [0x38280000, 0x3867fff0, 0x38680000, 0x38680000)
ro space 10240K, 44% used [0x38680000, 0x38af73f0, 0x38af7400, 0x39080000)
rw space 12288K, 52% used [0x39080000, 0x396cdd28, 0x396cde00, 0x39c80000)
resolvent :
increase Perm District
allow Class Recycling
3.Java Stack overflow
When creating a thread , You need to allocate stack space for threads , This stack space is requested from the operating system , If the operating system cannot give enough space , Will throw OOM
resolvent :
Reduce heap memory
Reduce the thread stack size
4. Direct memory overflow
Direct memory overflow
ByteBuffer.allocateDirect() Unable to get enough space from the operating system
resolvent :
Reduce heap memory
Intentional trigger GC
Four . Dominate the tree

5、 ... and . Shallow pile
1. The amount of memory occupied by an object structure
2. The object size is in accordance with 8 Byte alignment
3. The shallow heap size has nothing to do with the content of the object , Only related to the structure of the object
6、 ... and . Deep pile
1. An object is GC After recycling , The amount of memory that can actually be released
2. Accessible only through objects ( Directly or indirectly ) Sum of all objects in shallow heap ( Dominate the tree )
边栏推荐
- Slurm view node configuration information
- This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
- Summary of Chinese remainder theorem
- Problems and solutions of several concurrent scenarios of redis
- How to use websocket to realize simple chat function in C #
- Examination question bank of constructor decoration direction post skills (constructor) and examination data of constructor decoration direction post skills (constructor) in 2022
- Sword finger offer:55 - I. depth of binary tree
- Unity writes a character controller. The mouse controls the screen to shake and the mouse controls the shooting
- Don't disagree, this is the most powerful "language" of the Internet
- [untitled] the relationship between the metauniverse and digital collections
猜你喜欢

Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami

The difference between MCU serial communication and parallel communication and the understanding of UART

The 37 year old programmer was laid off, and he didn't find a job for 120 days. He had no choice but to go to a small company. As a result, he was confused

How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!

Redis transaction

This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
![[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush](/img/98/3e5f1094141e34d7e77f908e12acda.jpg)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush

Kiss number + close contact problem

Solve the problem that the tabbar navigation at the bottom of vantui does not correspond to the page (window.loading.hash)

Command Execution Vulnerability - command execution - vulnerability sites - code injection - vulnerability exploitation - joint execution - bypass (spaces, keyword filtering, variable bypass) - two ex
随机推荐
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
System integration meets the three business needs of enterprises
Recursive structure
Problems and solutions of several concurrent scenarios of redis
Zblog collection plug-in does not need authorization to stay away from the cracked version of zblog
How to use websocket to realize simple chat function in C #
3D game modeling is in full swing. Are you still confused about the future?
Examination question bank of constructor decoration direction post skills (constructor) and examination data of constructor decoration direction post skills (constructor) in 2022
Amélioration de l'efficacité de la requête 10 fois! 3 solutions d'optimisation pour résoudre le problème de pagination profonde MySQL
Consul of distributed service registration discovery and unified configuration management
This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
PID of sunflower classic
How to pipe several commands in Go?
(practice C language every day) pointer sorting problem
Rhcsa day 3
Latex tips slash \backslash
Résumé des outils communs et des points techniques de l'examen PMP
New year's first race, submit bug reward more!
Baijia forum the founding of the Eastern Han Dynasty
PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation