I have the following problem: I have an Kotlin host application that start another Java programm with
val process = ProcessBuilder(*split("java -jar second.jar").toTypedArray())
.directory(File(this.directory))
.redirectErrorStream(true)
.start();
On machine (PopOs 20.04, 16GB Ram) this works fine, but if I run it on the sever (Debian stretch, 8GB Ram ) the second.jar program throws a "java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached" exception.
Any ideas how I could fix it?