Get heap dump from a remote application in Java using JVisualVM

前端 未结 4 2039
梦如初夏
梦如初夏 2020-12-08 06:04

I run JVisualVM (Windows XP, Sun Java 1.6.0.13, 32 bit client VM) to monitor a distant application (Linux, Sun Java 1.6.0.07, 64 bit server VM). Before starting the actual r

4条回答
  •  被撕碎了的回忆
    2020-12-08 06:52

    There is a way to do it!

    1. rmiregistry -J-Xbootclasspath/p:$JAVA_HOME/lib/sa-jdi.jar ( this uses port 1099)
    2. start 'jsadebugd' on the machine in which application is running: jsadebugd & (pid of JVM)
    3. On remote machine use following jmap -dump:file= :1099

    4. jhat

    The above will start a web application at port 7000

    All the above tools are part of JDK 1.6

    All the best!

提交回复
热议问题