When a large TLS (Thread local storage) size is set for Threads, the JVM results in a stack overflow exception. The reason for this behavior is that the reaper thread was created with a low stack size of 32768k. When a large TLS size is set, it steals space from the threads stack, which eventually results in a stack overflow. This is a known glibc bug. To overcome this issue, we have introduced a workaround (jdk.lang.processReaperUseDefaultStackSize) in which the user can set the reaper threads stack size to a default instead of to 32768. This gives the reaper thread a bigger stack size, so for a large TLS size, such as 32k, the process will not fail. Users can set this flag in one of two ways: 1. -Djdk.lang.processReaperUseDefaultStackSize=true 2. System.setProperty("jdk.lang.processReaperUseDefaultStackSize", "true") The problem has been observed only when JVM is started from JNI code in which TLS is declared using "__thread"
|