Class ProcessInfo

java.lang.Object
org.springframework.boot.info.ProcessInfo

public class ProcessInfo extends Object
Information about the process of the application.
Since:
3.3.0
Author:
Jonatan Ivanov, Andrey Litvitski
  • Constructor Details

    • ProcessInfo

      public ProcessInfo()
  • Method Details

    • getCpus

      public int getCpus()
      Number of processors available to the process. This value may change between invocations especially in (containerized) environments where resource usage can be isolated (for example using control groups).
      Returns:
      result of Runtime.availableProcessors()
      See Also:
    • getMemory

      public ProcessInfo.MemoryInfo getMemory()
      Memory information for the process. These values can provide details about the current memory usage and limits selected by the user or JVM ergonomics (init, max, committed, used for heap and non-heap). If limits not set explicitly, it might not be trivial to know what these values are runtime; especially in (containerized) environments where resource usage can be isolated (for example using control groups) or not necessarily trivial to discover. Other than that, these values can indicate if the JVM can resize the heap (stop-the-world).
      Returns:
      heap and non-heap memory information
      Since:
      3.4.0
      See Also:
    • getVirtualThreads

      public ProcessInfo.VirtualThreadsInfo getVirtualThreads()
      Virtual threads information for the process. These values provide details about the current state of virtual threads, including the number of mounted threads, queued threads, the parallelism level, and the thread pool size.
      Returns:
      an instance of ProcessInfo.VirtualThreadsInfo containing information about virtual threads, or null if the VirtualThreadSchedulerMXBean is not available.
      Since:
      3.5.0
    • getPid

      public long getPid()
    • getParentPid

      public long getParentPid()
    • getOwner

      public String getOwner()