Hitachi

uCosminexus Application Server Definition Reference Guide


-XX:HitachiThreadLimit (Option for specifying the maximum number of threads)

Organization of this page

Format

-XX:HitachiThreadLimit=integer-value

Description

Specifies the upper limit for the number of threads. The OutOfMemoryError exception is thrown when the upper limit for the number of threads exceeds the specified value. However, if the upper limit exceeds before activating JavaVM, the exception will not be thrown. Also, threads that are created outside the management range of JavaVM by using application such as JNI will not be included in the number of threads. If 0 is specified, the upper limit is not set up.

Note that if this option is specified concurrently with the -XX:+HitachiOutOfMemoryAbort option, and if the OutOfMemoryError exception is thrown by the functionality of this option, JavaVM is not terminated forcibly.

Also, if this option is specified concurrently with the -XX:+HitachiOutOfMemoryStackTrace option, an exception message is output to the JavaVM log file.

Default value
  • -XX:HitachiThreadLimit=0

Argument

integer-value

Specify the upper limit for the number of threads in an integer between 0 and 2147483647 (unit: number of threads). However, if a value out of range is specified, 0 is set. When negative value is specified, an error will occur.

Output format

Could not create "name" thread. Threadlimit Exceeded. num threads exist.

You can acquire this message with java.lang.Throwable.getMessage(). Also, if the entire message is 128 single-byte characters or more, the end of the message is omitted.

name

Name of the thread that could not be created

num

Current number of threads

If -XX:+HitachiOutOfMemoryStackTrace option is specified, exception information and stack traces can be output to the JavaVM log file. The type of the exception cause is "Thread Limit". For the types of causes for the occurrence of exceptions, see -XX:[+|-]HitachiOutOfMemoryCause (Option to output the causes of exception).

Examples of output

Could not create "Thread-1" thread. Threadlimit Exceeded. 9 threads exist.

This is an example of the message retrieved using java.lang.Throwable.getMessage() when the main thread invokes java.lang.Thread.start and this functionality throws an exception.

Precautions

If you set up a small value as an upper limit, an exception will be thrown before the startup. Do not set up a value that is smaller than the number of threads used by the J2EE server.

For the number of threads used by a J2EE server, see 5. Estimating Resources to be Used (J2EE Application Execution Platform) or 6. Estimating Resources to be Used (Batch Application Execution Platform) in the manual uCosminexus Application Server System Design Guide.