Linux Process Management Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 21: Line 21:
</pre>
</pre>


For more details, see [[Sysctl#kernel.pid_max|sysctl]]. For more details about kernel runtime configuration see [[Kernel_Runtime_Configuration#pid_max|pid_max]].
For more details, see [[Sysctl#kernel.pid_max|sysctl]]. For more details about kernel runtime configuration see [[Kernel_Runtime_Configuration#kernel.pid_max|kernel.pid_max]].


To get the actual number of processes present in the system, see <tt>[[Linux_Process_Information#.2Fproc.2Fstat|/proc/stat]]</tt>.
To get the actual number of processes present in the system, see <tt>[[Linux_Process_Information#.2Fproc.2Fstat|/proc/stat]]</tt>.

Revision as of 17:38, 8 June 2017

Internal

Process

Threads

The number of threads for process can be read from the process' corresponding /proc/<pid>/status, as described here: "Threads:".

Maximum Number of Processes Allowed on the System

cat /proc/sys/kernel/pid_max

or

sysctl kernel.pid_max

For more details, see sysctl. For more details about kernel runtime configuration see kernel.pid_max.

To get the actual number of processes present in the system, see /proc/stat.

Maximum Number of Processes Available to a Single User

The current value can be read and set with ulimit -u.

For Java applications, this setting limits the number of threads a JVM can create, and it can cause the JVM to throw "java.lang.OutOfMemoryError: unable to create new native thread" exceptions when that limit is reached. For more details see

Java Threads and Linux Processes

The O/S level symptom of reaching the per-user process limit is:

-bash: fork: retry: Resource temporarily unavailable

while trying to execute an arbitrary process.