简体   繁体   中英

Java VisualVM heap space dump into output path

I need to know if it is possible to declare a output path for a heap space dump in the java visualVM. Is there any parameter that I can use for the java visual VM?

I have to trace a specific service on my server and need to get a dump of the heap space.

thanks.

UPDATE

Thanks a lot. I found a solution for my problem. I connected to my service with jmx remote. There it is possible to save the heapdump on any other drive of the server.

You can use the following visualvm.tmpdir system property to change the directory, where VisualVM stores snapshots, thread dumps and heap dumps. Usage:

visualvm -J-Dvisualvm.tmpdir=[custom_tmp_dir]

您可以更改 VisualVM 在 /etc/visualvm.conf 文件中使用的临时目录的位置,如下所示:

    visualvm_default_options=" ...  -J-Djava.io.tmpdir=<PATH> -J-Dvisualvm.tmpdir=<THE SAME PATH>"

For VisualVM 1.4.4 the following settings are needed in etc/visualvm.conf :

visualvm_default_userdir="<set-your-path>"
visualvm_default_options="<...> -J-Djava.io.tmpdir=<set-your-path>"
  • visualvm_default_userdir sets it for jmx based heap dumps.
  • visualvm_default_options sets it for process based heap dumps.

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