当前位置:网站首页>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 )
边栏推荐
- Safety tips - seat belt suddenly fails to pull? High speed police remind you how to use safety belts in a standardized way
- [Wu Enda deep learning] beginner learning record 3 (regularization / error reduction)
- Have you entered the workplace since the first 00???
- Solve the problems encountered by the laravel framework using mongodb
- Constantly changing harmonyos custom JS components during the Spring Festival - Smart Koi
- This function has none of DETERMINISTIC, NO SQL..... (you *might* want to use the less safe log_bin_t
- 2006 translation
- Recent learning fragmentation (14)
- Teach you how to optimize SQL
- Is online futures account opening safe and reliable? Which domestic futures company is better?
猜你喜欢

Talking about custom conditions and handling errors in MySQL Foundation

Have you entered the workplace since the first 00???

National standard gb28181 protocol platform easygbs fails to start after replacing MySQL database. How to deal with it?

There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection

Li Chuang EDA learning notes 13: electrical network for drawing schematic diagram

Pagoda SSL can't be accessed? 443 port occupied? resolvent

Cache general management class + cache httpcontext Current. Cache and httpruntime Differences between caches

Tsinghua University product: penalty gradient norm improves generalization of deep learning model

Hospital network planning and design document based on GLBP protocol + application form + task statement + opening report + interim examination + literature review + PPT + weekly progress + network to

AI 助力藝術設計抄襲檢索新突破!劉芳教授團隊論文被多媒體頂級會議ACM MM錄用
随机推荐
Recent learning fragmentation (14)
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
What is the difference between enterprise wechat applet and wechat applet
How to pipe several commands in Go?
Stm32bug [stlink forced update prompt appears in keilmdk, but it cannot be updated]
There is no need to authorize the automatic dream weaving collection plug-in for dream weaving collection
Enhanced for loop
150 ppt! The most complete "fair perception machine learning and data mining" tutorial, Dr. AIST Toshihiro kamishima, Japan
3D game modeling is in full swing. Are you still confused about the future?
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
Crawler practice website image batch download
Package details_ Four access control characters_ Two details of protected
Leecode 122. Zuijia timing of buying and selling stocks ②
New year's first race, submit bug reward more!
Rhcsa day 3
@Scheduled scheduled tasks
MySQL workbench use
Lichuang EDA learning notes 14: PCB board canvas settings
[development team follows] API specification
Consul of distributed service registration discovery and unified configuration management