title: how can I change the hsperfdata default dir?
body: <p>My Java Version</p>
  <blockquote>
  <p>java version &quot;1.8.0_91&quot; Java(TM) SE Runtime Environment (build
  1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)</p>
  </blockquote>
  <p>Start Java Process with such command:
  java -Djava.io.tmpdir=/home/root -XX:+UsePerfData Test</p>
  <p>Code Like this:</p>
  <pre><code>    public static final int jvmPid() {
      try {
        RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
        Field jvm = runtime.getClass().getDeclaredField(&quot;jvm&quot;);
        jvm.setAccessible(true);
        VMManagement mgmt = (VMManagement) jvm.get(runtime);
        Method pidMethod = mgmt.getClass().getDeclaredMethod(&quot;getProcessId&quot;);
        pidMethod.setAccessible(true);
        int pid = (Integer) pidMethod.invoke(mgmt);
        return pid;
      } catch (Exception e) {
        return -1;
      }
    }
  
  
  
  public static void main(String[] args) {
      int count = 0;
      while (true) {
        String property = &quot;java.io.tmpdir&quot;;
        String tempDir = System.getProperty(property);
        System.out.println(&quot;OS current temporary directory is &quot; + tempDir + &quot; pid is &quot; + jvmPid());
        try {
          Thread.sleep(1000);
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        count += 1;
        if (count &gt;= 10) {
          break;
        }
      }
    }
  </code></pre>
  <p>The hsperdata still in /tmp dir, why?</p>