How can I prevent Java from creating hsperfdata files?

后端 未结 8 1888
遥遥无期
遥遥无期 2020-12-24 02:15

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

8条回答
  •  暖寄归人
    2020-12-24 02:53

    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.
    

提交回复
热议问题