- Add "-Xss160k" to the JVM commandline
- Set "ulimit -s 160" from the Linux shell and confirm with "ulimit -a". This setting is per user session. To make it persist for a user, add it to /etc/security/limits.conf
[2] Track the total number of threads on the system:
watch 'ps -efL|wc -l'
Check the system limit:
cat /proc/sys/kernel/pid_max # Usually 32768
If the total number of threads reaches this pid_max, JVM will throw OOM with unable to create new native threads error.
To fix this issue:
- Increase the system limit as root:
echo 65536 > /proc/sys/kernel/pid_max - Or, to persist across reboots, add the following to /etc/sysctl.conf:
kernel.pid_max = 65536
No comments:
Post a Comment