Creating a Java JRE7 dump heap

I am trying to generate a bunch of heaps from my java program, but no matter what I seem to be trying, I cannot figure out how to do this.

I downloaded the Eclipse memory analyzer (a plugin and then standalone), which is supposed to be able to receive heat dumps from active jes processes ... but it doesn't have a single one. The documentation lists several other ways to create them, but I cannot get them to work, or they refer to something that simply does not exist on my system. The same applies to everything I managed to find on the Internet ...

The program does not throw an exception in memory, but simply uses much more resources, and I also expect this.

I will just completely lose how exactly this should be done: /

Any help would be greatly appreciated.

+6
source share
1 answer

You can do this manually using the Java JDK jmap.exe .

  • You get the PID your process.
  • Go to% JAVA_HOME% / bin / (JDK)
  • In the console (Command Prompt), enter jmap.exe -dump:format=b,file=C:\dump\dump.bin PID
    • The dump file is saved in the path you specified (in my example C:\dump\dump.bin )

You can then use the NetBeans IDE to analyze this dump. It has built-in tools, just import dump.bin .

+8
source

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


All Articles