当前位置:网站首页>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 )
边栏推荐
- Crawler practice website image batch download
- Rhcsa day 3
- Experience summary of the 12th Blue Bridge Cup (written for the first time)
- Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
- Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
- The difference between MCU serial communication and parallel communication and the understanding of UART
- Recent learning fragmentation (14)
- No clue about the data analysis report? After reading this introduction of smartbi, you will understand!
- Osnabrueck University | overview of specific architectures in the field of reinforcement learning
- false sharing
猜你喜欢
How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
Database concept and installation
Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram
New year's first race, submit bug reward more!
[latex] production of complex tables: excel2latex and detail adjustment
There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
Management and thesis of job management system based on SSM
Crawler practice website image batch download
Dare to climb here, you're not far from prison, reptile reverse actual combat case
随机推荐
Basé sur... Netcore Development blog Project Starblog - (14) Implementation of theme switching function
Summary of Chinese remainder theorem
Teach you how to optimize SQL
I stepped on a foundation pit today
Practical multifunctional toolbox wechat applet source code / support traffic master
Rhcsa day 3
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
Zhihu million hot discussion: why can we only rely on job hopping for salary increase? Bosses would rather hire outsiders with a high salary than get a raise?
How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
Redis transaction
Setting methods, usage methods and common usage scenarios of environment variables in postman
What is cloud primordial?
Baijia forum the founding of the Eastern Han Dynasty
Contest3145 - the 37th game of 2021 freshman individual training match_ D: Ranking
Backpropagation formula derivation [Li Hongyi deep learning version]
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
Crawler practice website image batch download
Is online futures account opening safe and reliable? Which domestic futures company is better?
Code Execution Vulnerability - no alphanumeric rce create_ function()