Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Java from creating hsperfdata files?

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?

like image 768
c-had Avatar asked Sep 16 '08 20:09

c-had


People also ask

What is Hsperfdata folder?

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 do I read Hsperfdata files?

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.


1 Answers

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. 
like image 195
Kyle Renfro Avatar answered Oct 07 '22 22:10

Kyle Renfro