How do I fix Out of Memory Unable to Create Native thread error?

How do I fix Out of Memory Unable to Create Native thread error?

AuthorFullName__c
Matthew Wang
articleNumber
000004870
ft:sourceType
Salesforce
FirstPublishedDate
2020-09-15T23:09:20Z
lastModifiedDate
2024-03-10T07:44:58Z
VersionNumber
5

Relevant versions: This information pertains to Artifactory version 6.x and 7.x.

If you encounter the following error in your logs:

java.lang.OutOfMemoryError: unable to create new native thread

you'll need to review several items to solve this problem.

First, increase the number of max open files or processes in /etc/security/limits.conf, and restart the application. For example:

*               hard    nofile          65535
*               soft    nofile          65535
*               hard    nproc          unlimited
*               soft    nproc         unlimited

Note: In SUSE Linux, you'll also need to set the DefaultTasksMax=65535 in /etc/systemd/system.conf, and restart your machine.

Next, increase your system max threads:

echo 100000 > /proc/sys/kernel/threads-max

More information about troubleshooting this issue is available HERE, HERE, and HERE.