How to increase maximum number of JVM threads (Linux 64bit)

后端 未结 3 441
自闭症患者
自闭症患者 2020-12-04 17:17

I cannot create more than 32k Java threads in Linux machine with 15G memory.

3条回答
  •  情歌与酒
    2020-12-04 17:36

    Additional information for modern (systemd) linux systems.

    There are many resources about this of values that may need tweaking (the other answer is a good source for most of them); however a new limit is imposed by way of the systemd "TasksMax" limit which sets pids.max on the cgroup.

    For login sessions the UserTasksMax default is 33% of the kernel limit pids_max (usually 12,288) and can be override in /etc/systemd/logind.conf.

    For services the DefaultTasksMax default is 15% of the kernel limit pids_max (usually 4,915). You can override it for the service by setting TasksMax in "systemctl edit" or update DefaultTasksMax in /etc/systemd/system.conf

提交回复
热议问题