Class JvmUtils

    • Method Detail

      • createThreadDump

        public static Collection<ThreadInfo> createThreadDump()
        Creates a thread dump of the current JVM.
        Returns:
        the thread dump of current JVM
      • createThreadInfoSample

        public static Optional<ThreadInfoSample> createThreadInfoSample​(long threadId,
                                                                        int maxStackTraceDepth)
        Creates a ThreadInfoSample for a specific thread. Contains thread traces if maxStackTraceDepth > 0.
        Parameters:
        threadId - The ID of the thread to create the thread dump for.
        maxStackTraceDepth - The maximum number of entries in the stack trace to be collected.
        Returns:
        The thread information of a specific thread.
      • createThreadInfoSample

        public static Map<Long,​ThreadInfoSample> createThreadInfoSample​(Collection<Long> threadIds,
                                                                              int maxStackTraceDepth)
        Creates a ThreadInfoSample for a specific thread. Contains thread traces if maxStackTraceDepth > 0.
        Parameters:
        threadIds - The IDs of the threads to create the thread dump for.
        maxStackTraceDepth - The maximum number of entries in the stack trace to be collected.
        Returns:
        The map key is the thread id, the map value is the thread information for the requested thread IDs.