Using Java: a memory analyzer (MAT) tool: comparing two heapdump parameters

I am using the Eclipse + MAT plugin. I could see one history of hapf files, I take two snapshots of my Java application. I wish, when I compare two heap heaps, I could determine which instances of the objects are greatly increasing so that I can identify the memory leak potential.

Can netbean do this?

+7
source share
2 answers

It can be done. See the IBMs Blog .

Basically you open both, and then on the histogram there is an additional button (the rightmost one) for comparison.

+2
source

instructions

  1. Open both heaps in MAT
  2. Open a histogram for any heap dump that exhibits abnormal behavior (usually with higher memory or thread usage).

enter image description here

  1. Compare this to another heap dump

enter image description here

  1. Select the appropriate heap dump from the list.

enter image description here

Interpretation of Results

enter image description here

Class name: a class that is created in the application and takes up memory

Objects: The number of instances of this class is above or below another heap dump.

Shallow Heap: The number of bytes that this class occupies in memory above or below another heap dump.

hints

Since MAT sorts in descending order by default, I recommend switching the column order of Objects and Shallow Heap to see the top outliers for each in both directions.

You should usually ignore pure Java classes such as Strings, Arrays, and Maps, and focus on the classes that your application defines.

Link

Feature Comparison Eclipse White Paper

0
source

Source: https://habr.com/ru/post/1434826/


All Articles