0
votes

so we have some Gameservers running on our V-Servers ( the one Im talking about has 8vCores with 4.2GHz and 32GB DDR4 RAM ), for example Minecraft. Our problem is that the server runs out of memory at around 640 Threads ( it doesnt care with which stack size, 1024KB, 512KB all the same result ). So is there any way to get more threads out of our system?

Linux: Debian 9 Virtuozzo Container
Java:
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-8u232-b09-1~deb9u1-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)

systemd/system.conf:
DefaultTasksMax=infinity

ulimit -a:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 3088273
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 62987
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited

and thats it I think.

java -Xss512k DieLikeADog ( but the stack size doesnt make a difference ) The error is:
New thread #634
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:717)
at DieLikeADog.main(DieLikeADog.java:20)
Killed
With the thread creation tool from this thread:
How many threads can a Java VM support?

Best regards

1
The important part of the DieLikeADog test is the last row before that error message it seems though. Indicating how many threads could be created. Along with the command line used of course.Mattias Isegran Bergander
thx @MattiasIsegranBergander edited itAzoni
A few useful notes ...rtybase

1 Answers

0
votes

You really should be able to go a lot higher than that with all those settings and configurations.

I would suggest that it is a limition imposed on your machine by the host provider.

This is not unheard of, for example see this superuser question:

https://superuser.com/questions/360000/613-threads-limit-on-debian

With the following follow-up self answer:

"Just got the following information: This is a limitation imposed by my host provider."