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
As an addendum to Mack's reply (answered Mar 25 '11 at 17:12), the option java.tmp.dir looks no longer available since Java 8. See the info at: https://bugs.java.com/view_bug.do?bug_id=8189674
So disabling the option using -XX:-UsePerfData seems the only option not to have hsperfdata_* files.
Rather than switching it off, change the java.io.tmpdir location. Add -Djava.io.tmpdir=/mydir/somewhere/else/ to your Java startup command and then the file will be somewhere that you control.
Note a comment by @simonc: this only works in a few versions of the JVM and is no longer supported. See http://bugs.sun.com/view_bug.do?bug_id=6447182, http://bugs.sun.com/view_bug.do?bug_id=6938627, http://bugs.sun.com/view_bug.do?bug_id=7009828 for more information.