I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps creating /tmp/hsperfdata_username
directories, which I would like to prevent. Is there any way to stop java from creating these files?
What's hsperfdata file? It is a log directory created by JVM while running your code. By default it is created inside the tmp folder of the operating system that you are using! This directory is a part of Java Performance counter. And the file in this directory is named by the pid number of java process.
How to Read hsperfdata File? To display statistics collected in PerfData memory, you can use: jstat^[3]^ Experimental JVM Statistics Monitoring Tool - It can attach to an instrumented HotSpot Java virtual machine and collects and logs performance statistics as specified by the command line options.
Try JVM option -XX:-UsePerfData
more info
The following might be helpful that is from link https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html
-XX:+UsePerfData Enables the perfdata feature. This option is enabled by default to allow JVM monitoring and performance testing. Disabling it suppresses the creation of the hsperfdata_userid directories. To disable the perfdata feature, specify -XX:-UsePerfData.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With