I run a Java application with OpenJDK 8 on Fedora 27, and since some time it logs this from time to time:
kernel: cgroup: fork rejected by pids controller in /system.slice/my.service
It then also immediately produces:
java: Exception in thread "acme" java.lang.OutOfMemoryError: unable to create new native thread
I don't believe the application "leaks" threads. I could be wrong though.
How can I check the system parameters which cause these errors, and how can I modify them to prevent the errors?
The service is run with:
java -Xmx1G -jar myservice.jar