简体   繁体   中英

Heap dump browser in visualvm?

I'm monitoring an application with VisualVM on a remote server running Tomcat 7. When I try to open the heap dump browser all I get is a window prompting me to enter a path for the dump file to be saved but there is no browser window.

I'm starting tomcat with the below variables

export JAVA_OPTS="-Dcom.sun.management.jmxremote=true \\ -Dcom.sun.management.jmxremote.port=9090 \\ -Dcom.sun.management.jmxremote.ssl=false \\ -Dcom.sun.management.jmxremote.authenticate=false \\ -Djava.rmi.server.hostname=host ip"

Is there a way for me to open a heap dump browser window when connecting to a remote application?

Unfortunately there's no direct way to do that. You can use jVisualVM to monitor a remote java process but taking a heap dump is not possible. If you think about it, it makes sense because your heap dump file (.hprof) is usually of the size of MBs or GBs depending on your running java process and it's not easy to capture and transfer all that data in real time.

If you've access to running programs on that remote server, log into that and use jmap to take heap dump by pointing your java ProcessID like this,

jmap -dump:file=absolute-path-of-dumpfile ProcessID

and then copy the dump to your local for analysis.

For more info, you can refer to this SO link

You can actually do that with JProfiler but this is a licensed tool. I believe trial version does not include feature for remote JVM. Google it.

Actually you can take a heap dump from a remote application but you can't browse it immediately. The dialog asks you to provide path on the remote system where the heap dump file will be saved for you. To open it in VisualVM you have to manually transfer the file to your local machine and use File | Load... in VisualVM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM