/** * Like {@code jcmd Thread.print -l}. * Logs a warning if there was an error getting the thread dump. * @return Human-readable dump of all thread stacks. {@code null} if there was an error getting it. */ @Nullable public static String format() { return Dcmd.invoke("threadPrint", "-l"); } }
/** * Requires JVM argument {@code -XX:NativeMemoryTracking=summary}. * Logs a warning if there was an error getting the NMT summary or if NMT was disabled. * This warning will be logged only once per process instance. * Available here in case you want easy access to the raw output from the VM (instead of our nice parse). * Like {@code jcmd VM.native_memory summary}. * @return JVM-formatted human-readable NMT summary. null if there was an error getting the summary. */ @Nullable public static String invoke() { final String ret = Dcmd.invoke("vmNativeMemory", "summary"); if (NMT_DISABLED.equals(ret)) { if (!NMT_DISABLED_DID_WARN) { LOG.warn(ret.trim()); NMT_DISABLED_DID_WARN = true; } return null; } return ret; }