当前位置:网站首页>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 )
边栏推荐
- Eh, the log time of MySQL server is less than 8h?
- Setting methods, usage methods and common usage scenarios of environment variables in postman
- AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用
- Contest3145 - the 37th game of 2021 freshman individual training match_ D: Ranking
- Setting methods, usage methods and common usage scenarios of environment variables in postman
- Www 2022 | taxoenrich: self supervised taxonomy complemented by Structural Semantics
- 長文綜述:大腦中的熵、自由能、對稱性和動力學
- Site favorites
- Rhcsa day 2
- 96% of the collected traffic is prevented by bubble mart of cloud hosting
猜你喜欢
This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
MySQL data query optimization -- data structure of index
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"
Talking about custom conditions and handling errors in MySQL Foundation
Consul of distributed service registration discovery and unified configuration management
Li Chuang EDA learning notes IX: layers
Audio and video technology development weekly | 232
Fudan released its first review paper on the construction and application of multimodal knowledge atlas, comprehensively describing the existing mmkg technology system and progress
ZABBIX API pulls the values of all hosts of a monitoring item and saves them in Excel
随机推荐
Base d'apprentissage de la machine: sélection de fonctionnalités avec lasso
Contest3145 - the 37th game of 2021 freshman individual training match_ 1: Origami
what does ctrl + d do?
Unspeakable Prometheus monitoring practice
查詢效率提昇10倍!3種優化方案,幫你解决MySQL深分頁問題
Package and download 10 sets of Apple CMS templates / download the source code of Apple CMS video and film website
Experience summary of the 12th Blue Bridge Cup (written for the first time)
Want to do something in production? Then try these redis commands
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
Session learning diary 1
Crawler practice website image batch download
[Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
MySQL is dirty
Unity writes a character controller. The mouse controls the screen to shake and the mouse controls the shooting
How much does it cost to open a futures account in China? Where is it safe to open an account at present?
Redis notes (I) Linux installation process of redis
Contest3145 - the 37th game of 2021 freshman individual training match_ F: Smallest ball
Eh, the log time of MySQL server is less than 8h?
In my spare time, I like to write some technical blogs and read some useless books. If you want to read more of my original articles, you can follow my personal wechat official account up technology c