Memory leak analysis using MAT combat

Before analysis can be read under this article, a lot of content will all know https://www.jianshu.com/p/738b4f3bc44b , following an article I analyze the memory leak is a problem

1. Click on

Leak Suspects this link to view the memory leaks

 

 

 2. Problem display, view details

 

 3. Detailed information in this step is very arraylist actually see some more practical stack occupied here, to be the heap, and stack retention, are explained in the link,

 

 t represents the shortest path to GC root memory consumption aggregation point, if there is a memory consumption of focal path to GC root, the memory consumption agglomerations are not considered to be garbage collected. Is also located arraylist, this function is a problem, look at the code and found that list only grow, not to release the code has been located

 

 

4. In fact, there is a most convenient way, grab two files, compare to see the size of the heap, the heap if some data continues to rise, not fall, it may be a problem in the thread also has proposed main diagnosis memory leak function

 

Guess you like

Origin www.cnblogs.com/chongyou/p/11710339.html