Class LinuxOSProcessNF
java.lang.Object
oshi.software.common.AbstractOSProcess
oshi.software.common.os.linux.LinuxOSProcess
oshi.software.common.os.linux.nativefree.LinuxOSProcessNF
- All Implemented Interfaces:
OSProcess
Native-free Linux OS process implementation. Extends
LinuxOSProcess, providing implementations that require
no native access.-
Nested Class Summary
Nested classes/interfaces inherited from interface OSProcess
OSProcess.StateModifier and TypeInterfaceDescriptionstatic enumProcess and Thread Execution States -
Constructor Summary
ConstructorsConstructorDescriptionLinuxOSProcessNF(int pid, LinuxOperatingSystem os) Creates a new native-free Linux OS process. -
Method Summary
Modifier and TypeMethodDescriptionprotected longQueries the hard open file limit for the current process via nativegetrlimit.protected longQueries the soft open file limit for the current process via nativegetrlimit.Methods inherited from class LinuxOSProcess
getAffinityMask, getArguments, getBitness, getBytesRead, getBytesWritten, getCommandLine, getCurrentWorkingDirectory, getEnvironmentVariables, getGroup, getGroupID, getHardOpenFileLimit, getInvoluntaryContextSwitches, getKernelTime, getMajorFaults, getMinorFaults, getName, getOpenFiles, getOs, getParentProcessID, getPath, getPriority, getPrivateResidentMemory, getProcessOpenFileLimit, getResidentMemory, getSoftOpenFileLimit, getStartTime, getState, getThreadCount, getThreadDetails, getUpTime, getUser, getUserID, getUserTime, getVirtualSize, getVoluntaryContextSwitches, updateAttributesModifier and TypeMethodDescriptionlongGets the process affinity mask for this process.Makes a best effort attempt to get a list of the the command-line arguments of the process.intAttempts to get the bitness (32 or 64) of the process.longGets the bytes read by the process.longGets the bytes written by the process.Gets the process command line used to start the process, including arguments if available to be determined.Makes a best effort attempt to obtain the current working directory for the process.Makes a best effort attempt to obtain the environment variables of the process.getGroup()Gets the group under which the process is executing.Gets the group id under which the process is executing.longGets the hard limit for open file handles (or network connections) that belong to the given process.longThe number of involuntary context switches the process has made.longGets kernel/system (privileged) time used by the process.longGets the number of major (hard) faults the process has made which have required loading a memory page from disk.longGets the number of minor (soft) faults the process has made which have not required loading a memory page from disk.getName()Gets the name of the process, often the executable program.longGets the number of open file handles (or network connections) that belongs to the process.protected LinuxOperatingSystemgetOs()Returns theLinuxOperatingSysteminstance associated with this process.intGets the process ID of this process's parent.getPath()Gets the full filesystem path of the executing process.intGets the priority of this process.longReturns an estimate of the portion of physical memory (RAM) uniquely attributed to this process.protected longgetProcessOpenFileLimit(long processId, int index) Gets the open file limit for a process.longReturns the total amount of physical memory (RAM) currently mapped to the process's address space.longGets the soft limit for open file handles (or network connections) of the given process.longGets the process start time.getState()Gets the process state.intGets the number of threads being executed by this process.Retrieves the threads of the process and their details.longGets up time / elapsed time since the process started.getUser()Gets the user name of the process owner.Gets the user id of the process owner.longGets user time used by the process.longGets the Virtual Memory Size (VSZ).longThe number of voluntary context switches the process has made.booleanAttempts to update process attributes.Methods inherited from class AbstractOSProcess
getProcessCpuLoadBetweenTicks, getProcessCpuLoadCumulative, getProcessID, toStringModifier and TypeMethodDescriptiondoublegetProcessCpuLoadBetweenTicks(OSProcess priorSnapshot) Gets CPU usage of this process since a previous snapshot of the same process, provided as a parameter.doubleGets cumulative CPU usage of this process.intGets the process ID.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OSProcess
getContextSwitchesModifier and TypeMethodDescriptiondefault longA snapshot of the context switches the process has done, equal to the sum ofOSProcess.getVoluntaryContextSwitches()andOSProcess.getInvoluntaryContextSwitches()on platforms that provide the split.
-
Constructor Details
-
LinuxOSProcessNF
Creates a new native-free Linux OS process.- Parameters:
pid- the process IDos- the operating system instance
-
-
Method Details
-
queryRlimitSoft
protected long queryRlimitSoft()Description copied from class:LinuxOSProcessQueries the soft open file limit for the current process via nativegetrlimit.- Specified by:
queryRlimitSoftin classLinuxOSProcess- Returns:
- the soft limit value
-
queryRlimitHard
protected long queryRlimitHard()Description copied from class:LinuxOSProcessQueries the hard open file limit for the current process via nativegetrlimit.- Specified by:
queryRlimitHardin classLinuxOSProcess- Returns:
- the hard limit value
-