当前位置:网站首页>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 )
边栏推荐
- Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]
- CSP drawing
- [source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
- The "two-way link" of pushing messages helps app quickly realize two-way communication capability
- Backpropagation formula derivation [Li Hongyi deep learning version]
- Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
- [untitled] the relationship between the metauniverse and digital collections
- The first spring of the new year | a full set of property management application templates are presented, and Bi construction is "out of the box"
- Add token validation in swagger
- Don't disagree, this is the most powerful "language" of the Internet
猜你喜欢

7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages

MySQL is dirty

Summary of Chinese remainder theorem
![Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]](/img/0d/7a8370d153a8479b706377c3487220.jpg)
Stm32bug [the project references devices, files or libraries that are not installed appear in keilmdk]

1day vulnerability pushback skills practice (3)

Development of digital collection trading platform development of digital collection platform

Node solves cross domain problems

Audio and video technology development weekly | 232

7 * 24-hour business without interruption! Practice of applying multiple live landing in rookie villages

A brief talk on professional modeler: the prospect and professional development of 3D game modeling industry in China
随机推荐
Johnson–Lindenstrauss Lemma
2022 Guangxi provincial safety officer a certificate examination materials and Guangxi provincial safety officer a certificate simulation test questions
Setting methods, usage methods and common usage scenarios of environment variables in postman
PTA tiantisai l1-079 tiantisai's kindness (20 points) detailed explanation
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
MySQL backup notes
Record a problem that soft deletion fails due to warehouse level error
AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用
Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
Tsinghua University product: penalty gradient norm improves generalization of deep learning model
Pagoda SSL can't be accessed? 443 port occupied? resolvent
2022 examination summary of quality controller - Equipment direction - general basis (quality controller) and examination questions and analysis of quality controller - Equipment direction - general b
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
WordPress collection WordPress hang up collection plug-in
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
[untitled] the relationship between the metauniverse and digital collections
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
Learning video website
Teach you how to optimize SQL
CSP drawing