public static void dumpHeapToTmp(String... args) {
    String tmpDir = System.getProperty("java.io.tmpdir");
    if (StringUtils.isBlank(tmpDir)) {
      tmpDir = "/tmp/";
    }
    String fileName =  tmpDir + File.pathSeparatorChar + "dump";
    for (String arg : args) {
      fileName += "_" + arg;
    }
    fileName += "_" + System.nanoTime() + ".hprof";
    dumpHeap(fileName, true);
  }
Dumps process heap to a file in temp directoty.
@param args Strings to use to build a file name (dump_arg0_arg1_....).
ql/src/java/org/apache/hadoop/hive/ql/debug/Utils.java