Ulimit Overview

Compatibility :3.5.31
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

The Java Service Wrapper has the ability to limit the use of system-wide resources.

A resource has 2 limits: soft and hard. Here are the rules to respect:

  • The soft limit cannot be greater than the hard limit.
  • The hard limit can't be changed to a value higher than the one set by the root user.

To see the current limits on your system, please run the following commands in a terminal:

Show limits:
# To see the list of soft limits:
ulimit -a

# To see the list of hard limits:
ulimit -Ha

Currently, <resource> can be the following:

  • nofile (Since 3.5.31):

    To set the limits for the number of open file descriptors, that is the maximum number of files that the Wrapper and its child process can open.

  • data (Since 3.5.33):

    To set the limits for the data segment size of each processes started by the Wrapper.

As an alternative to the Wrapper properties, you can also use the built-in 'ulimit' command within the shell script that launches the Wrapper. The shell's resource limits will be inherited by the Wrapper, the Java application and all its child processes.

Example:
# Set the soft limit for the number of file descriptors:
ulimit -n 2048

# Set the hard limit for the number of file descriptors:
ulimit -H -n 50000

NOTE

The range of allowed values may vary depending on the OS and the type of resource. Some systems will allow the value 'unlimited' to be set for certain resources while others won't accept this value.

Setting wrapper.ulimit.nofile.strict to FALSE or wrapper.ulimit.nofile.soft to HARD may help by automatically increasing the values to their maximums.

wrapper.ulimit.<resource>.soft

Compatibility :3.5.31
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

This property is used to set the soft limit for the specified resource. It applies to the Wrapper and its child processes.

The default value is inherited from the limits set on the shell that started the Wrapper.

The value 'HARD' can be used to set the soft limit to the value of hard limit.

The value 'UNLIMITED' can be used to set the limit to the maximum supported by the OS. This however requires the hard limit to be set to UNLIMITED as well.

NOTE

If 'unlimited' is not supported by the OS for the specified resource, it will be resolved to the value of the current hard limit when wrapper.ulimit.<resource>.strict is set to FALSE.

Example:
wrapper.ulimit.nofile.soft=2048
wrapper.ulimit.data.soft=unlimited

wrapper.ulimit.<resource>.hard

Compatibility :3.5.31
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

This property is used to set the hard limit for the specified resource. It applies to the Wrapper and its child processes.

The default value is inherited from your system configuration.

The value 'UNLIMITED' can be used to set the limit to the maximum supported by the OS. This however requires the Wrapper to be run as the root user.

NOTE

If 'unlimited' is not supported by the OS for the specified resource, it will be resolved to the value of the current hard limit when wrapper.ulimit.<resource>.strict is set to FALSE.

Example:
wrapper.ulimit.nofile.hard=65536
wrapper.ulimit.data.hard=unlimited

wrapper.ulimit.<resource>.strict

Compatibility :3.5.31
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

When set to TRUE, the property tells the Wrapper to stop if it is not possible to set the limit for the specified resource as defined in the configuration.

If the value is FALSE, an attempt will be made to adjust the hard and soft limits as close as possible to the configured values. A warning will be shown and the Wrapper will continue. Being not strict can be useful when the same configuration needs to be used on several machines set up with different resource limits. The Wrapper will however stop in case of incorrect configuration such as when both the hard and soft limits are specified with the soft limit being higher than the hard limit.

The default value is TRUE.

Example:
wrapper.ulimit.nofile.strict=FALSE

wrapper.ulimit.loglevel

Compatibility :3.5.31
Editions :Professional EditionStandard EditionCommunity Edition
Platforms :Windows (Not Supported)Mac OSXLinuxIBM AIXFreeBSDHP-UXSolarisIBM z/OSIBM z/Linux

Controls at which log level resource limits will be logged.

The default value is DEBUG.

Example:
wrapper.ulimit.loglevel=STATUS