private static void createThreadInfoMapUsingSingleCall(
      ThreadMXBean threadMXBean, Set<Long> stuckThreadIds, boolean showLocks,
      Map<Long, ThreadInfo> result) {
    long[] ids = new long[stuckThreadIds.size()];
    int idx = 0;
    for (long id : stuckThreadIds) {
      ids[idx] = id;
      idx++;
    }
    /*
     * NOTE: at least some implementations of getThreadInfo(long[], boolean, boolean)
     * will core dump if the long array contains a duplicate value.
     * That is why stuckThreadIds is a Set instead of a List.
     */
    ThreadInfo[] threadInfos = threadMXBean.getThreadInfo(ids, showLocks, showLocks);
    for (ThreadInfo threadInfo : threadInfos) {
      if (threadInfo != null) {
        result.put(threadInfo.getThreadId(), threadInfo);
      }
    }
  }
If set to true, then the JVM will be asked for all potential stuck threads with one call.
Since getThreadInfo on many JVMs, stops ALL threads from running, and since getting info
on multiple threads with one call is additional work, setting this can cause an extra long
stop the world that can then cause other problems (like a forced disconnect).
So be careful setting this to true.
geode-core/src/main/java/org/apache/geode/internal/monitoring/ThreadsMonitoringProcess.java