Вопрос

I'm trying to generate a heap dump from my java program, but no matter what I seem to try I can't seem to figure out how to do so.

I downloaded the Eclipse Memory Analyzer (Plugin and then Standalone) which is supposed to be able to aquire heat dumps from active jre processes.. yet it lists none. The documentation lists several otherways of generating them, but I can't seem to make any of them work, or they refer to something that just doesn't seem to exist on my system. Same applies from anything I've managed to find on the web...

The program isn't causing an out of memory exception, its just using far more resources then I'm expecting it too.

I'm just at a complete loss at how exactly its supposed to be done :/

Any help would be appreciated thanks.

Это было полезно?

Решение

You can do it manually, using Java JDK's jmap.exe.

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

Then you can use NetBeans IDE to analyze this dump. It has an inbuilt tools, just import the dump.bin.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top